Commit 9d7f852c authored by Niklas Yann Wettengel's avatar Niklas Yann Wettengel
Browse files

drive_to: use homer_tts

parent b8d97034
......@@ -20,6 +20,7 @@ find_package(catkin REQUIRED COMPONENTS
homer_robbie_architecture
trajectory_msgs
homer_tools
homer_tts
)
find_package(OpenCV REQUIRED)
......
......@@ -72,13 +72,10 @@ private:
void publishFeedback(float progress, std::string feedback);
void speakBlocked(std::string text);
void setTorsoPosition(float position);
ros::Publisher m_set_torso_pub_;
bool m_speaking;
bool m_check_obstacle;
StateMachine<State> m_statemachine;
......@@ -90,7 +87,6 @@ private:
ros::Publisher m_map_layer_pub_;
ros::Publisher m_navigate_to_poi_pub_;
ros::Publisher m_start_navigation_pub_;
ros::Publisher m_text_out_pub_;
tf::TransformListener m_transform_listener;
......
......@@ -21,6 +21,7 @@
<build_depend>homer_msgs</build_depend>
<build_depend>homer_robbie_architecture</build_depend>
<build_depend>homer_tools</build_depend>
<build_depend>homer_tts</build_depend>
<build_depend>move_base_msgs</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>pcl_conversions</build_depend>
......@@ -41,6 +42,7 @@
<run_depend>homer_ptu_msgs</run_depend>
<run_depend>homer_msgs</run_depend>
<run_depend>homer_robbie_architecture</run_depend>
<run_depend>homer_tts</run_depend>
<run_depend>move_base_msgs</run_depend>
<run_depend>nav_msgs</run_depend>
<run_depend>roscpp</run_depend>
......
......@@ -7,6 +7,8 @@
#include "trajectory_msgs/JointTrajectory.h"
#include "trajectory_msgs/JointTrajectoryPoint.h"
#include <homer_tts/HomerTtsLib.h>
namespace
{
typedef homer_mapnav_msgs::DetectObstacleResult detect;
......@@ -50,7 +52,7 @@ void DriveTo::targetUnreachableCallback(const homer_mapnav_msgs::TargetUnreachab
result.result = homer_mapnav_msgs::DriveToResult::FAILED_TARGET_UNREACHABLE;
if (!m_goal->suppress_speaking)
{
speakBlocked("I am not able to reach the target");
homer_tts::speak_blocked("I am not able to reach the target");
}
if (m_check_obstacle
......@@ -119,7 +121,7 @@ void DriveTo::targetReachedCallback(const std_msgs::String::ConstPtr& p)
if (!m_goal->suppress_speaking)
{
speakBlocked("I completed the drive to action");
homer_tts::speak_blocked("I completed the drive to action");
}
homer_mapnav_msgs::DriveToResult result;
......@@ -195,9 +197,7 @@ void DriveTo::driveToCallback()
m_goal->stop_before_obstacle);*/
if (!m_goal->suppress_speaking)
{
std_msgs::String msg;
msg.data = "I am driving to " + m_goal->goal_location;
m_text_out_pub_.publish(msg);
homer_tts::speak( "I am driving to " + m_goal->goal_location );
}
homer_mapnav_msgs::NavigateToPOI msg;
msg.poi_name = m_goal->goal_location;
......@@ -275,6 +275,8 @@ DriveTo::DriveTo(ros::NodeHandle n)
this->init();
m_nh_ = n;
homer_tts::init(m_nh_);
m_as_.registerGoalCallback(boost::bind(&DriveTo::driveToCallback, this));
m_mbas_.registerGoalCallback(boost::bind(&DriveTo::moveBaseCallback, this));
m_as_.start();
......@@ -304,26 +306,9 @@ DriveTo::DriveTo(ros::NodeHandle n)
m_set_torso_pub_
= m_nh_.advertise<trajectory_msgs::JointTrajectory>("/torso_controller/command", 1);
m_text_out_pub_ = m_nh_.advertise<std_msgs::String>("/robot_face/text_out", 1);
ROS_INFO_STREAM("[driveto] Action Node initialized");
}
void DriveTo::speakBlocked(std::string text)
{
ROS_INFO_STREAM("[driveto] speakBlocked");
std_msgs::String msg;
msg.data = text;
m_text_out_pub_.publish(msg);
std_msgs::String::ConstPtr answer
= ros::topic::waitForMessage<std_msgs::String>("/robot_face/talking_finished");
while (answer->data != text)
{
answer = ros::topic::waitForMessage<std_msgs::String>("/robot_face/talking_finished");
}
ROS_INFO_STREAM("[driveto] speakBlocked finished");
}
DriveTo::~DriveTo() {}
void DriveTo::init()
......
......@@ -16,7 +16,7 @@ class NavigationInterface:
goal = DriveToGoal()
goal.goal_location = poi_name
goal.distance_to_target = distance_to_target
rospy.loginfo("[DriveToBlocked] speaking: " + str(suppress_speaking))
rospy.loginfo("[DriveToBlocked] speaking: " + str(not suppress_speaking))
goal.suppress_speaking = suppress_speaking
goal.skip_final_turn = skip_final_turn
goal.stop_before_obstacle = stop_before_obstacle
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment