8 private_nh.
param<std::string>(
"autonomy_cmd_vel_topic",
13 std::string navigation_plugin;
14 private_nh.
param<std::string>(
"navigation_plugin", navigation_plugin,
"");
15 if (navigation_plugin.compare(
"rsm::NavigationState") == 0) {
17 "setNavigationToReverse",
19 std::ostringstream autonomy_cmd_vel_reverse_topic;
20 autonomy_cmd_vel_reverse_topic << _autonomy_cmd_vel_topic <<
"_reverse";
22 autonomy_cmd_vel_reverse_topic.str(), 10,
28 std::string calculate_goal_plugin;
29 private_nh.
param<std::string>(
"calculate_goal_plugin",
30 calculate_goal_plugin,
"");
31 if (calculate_goal_plugin.compare(
"rsm::CalculateGoalState") == 0) {
33 private_nh.
param<
double>(
"exploration_goal_tolerance",
42 "explorationGoals", 1);
50 rsm_msgs::GetNavigationGoal>(
"getNavigationGoal");
55 std::string mapping_plugin;
56 private_nh.
param<std::string>(
"mapping_plugin", mapping_plugin,
"");
57 if (mapping_plugin.compare(
"rsm::KinectMappingState") == 0) {
59 "resetKinectPosition",
62 "kinect_controller/command", 1,
true);
84 std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &res) {
86 res.message =
"Mode set";
91 const geometry_msgs::Twist::ConstPtr& cmd_vel) {
92 geometry_msgs::Twist cmd_vel_reversed;
93 cmd_vel_reversed.linear.x = cmd_vel->linear.x * -1;
94 cmd_vel_reversed.linear.y = cmd_vel->linear.y * -1;
95 cmd_vel_reversed.linear.z = cmd_vel->linear.z * -1;
96 cmd_vel_reversed.angular.x = cmd_vel->angular.x;
97 cmd_vel_reversed.angular.y = cmd_vel->angular.y;
98 cmd_vel_reversed.angular.z = cmd_vel->angular.z;
103 const move_base_msgs::MoveBaseGoalConstPtr& frontier_goal) {
104 as->
setSucceeded(move_base_msgs::MoveBaseResult(),
"Goal reached.");
126 const rsm_msgs::GoalStatus::ConstPtr& goal_status) {
127 if (goal_status->goal_status == rsm_msgs::GoalStatus::REACHED) {
129 }
else if (goal_status->goal_status == rsm_msgs::GoalStatus::FAILED) {
135 const visualization_msgs::MarkerArray::ConstPtr& frontiers) {
137 for (
auto it : frontiers->markers) {
138 if (it.type == visualization_msgs::Marker::POINTS) {
139 int frontier_size = it.points.size();
140 if (frontier_size > 0) {
141 geometry_msgs::Pose point;
142 point.position.x = it.points[frontier_size / 2].x;
143 point.position.y = it.points[frontier_size / 2].y;
144 point.position.z = it.points[frontier_size / 2].z;
145 point.orientation.w = 1.0;
158 const std_msgs::Bool::ConstPtr& exploration_mode) {
171 rsm_msgs::GetNavigationGoal srv;
173 geometry_msgs::Pose navigation_goal = srv.response.goal;
176 navigation_goal.position.x - iterator.position.x);
178 navigation_goal.position.y - iterator.position.y);
180 navigation_goal.position.z - iterator.position.z);
188 ROS_ERROR(
"Failed to call Get Navigation Goal service");
194 std_srvs::Trigger::Request &req, std_srvs::Trigger::Response &res) {
195 std_msgs::Float64 kinect_command;
196 kinect_command.data = 0.0;
void explorationModeCallback(const std_msgs::Bool::ConstPtr &exploration_mode)
ros::ServiceServer _reset_kinect_position_serivce
geometry_msgs::PoseArray _exploration_goals
void publish(const boost::shared_ptr< M > &message) const
void explorationGoalCallback(const rsm_msgs::GoalStatus::ConstPtr &goal_status)
ros::Publisher _failed_goals_publisher
ros::Subscriber _reverse_mode_cmd_vel_subscriber
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ros::Publisher _kinect_joint_controller
ros::Publisher _exploration_goals_publisher
void frontierCallback(const visualization_msgs::MarkerArray::ConstPtr &frontiers)
bool call(MReq &req, MRes &res)
void reverseModeCmdVelCallback(const geometry_msgs::Twist::ConstPtr &cmd_vel)
ros::ServiceClient _get_navigation_goal_service
std::string _autonomy_cmd_vel_topic
bool navGoalIncludedInFrontiers()
ros::Subscriber _exploration_mode_subscriber
ros::Publisher _reverse_mode_cmd_vel_publisher
AdditionsServiceProvider()
ros::ServiceServer _set_navigation_to_reverse_service
double _exploration_goal_tolerance
ros::Subscriber _exploration_goal_subscriber
void setSucceeded(const Result &result=Result(), const std::string &text=std::string(""))
ros::Subscriber frontiers_marker_array_subscriber
MoveBaseActionServer * as
void publishExplorationGoals()
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
void publishFailedGoals()
ros::Publisher _goal_obsolete_publisher
void publishGoalObsolete()
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
~AdditionsServiceProvider()
actionlib::SimpleActionServer< move_base_msgs::MoveBaseAction > MoveBaseActionServer
void navigationGoalCallback(const move_base_msgs::MoveBaseGoalConstPtr &frontier_goal)
#define ROS_INFO_STREAM(args)
geometry_msgs::PoseArray _failed_goals
bool setNavigationToReverse(std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &res)
bool _calculate_goal_plugin_used
bool resetKinectPosition(std_srvs::Trigger::Request &req, std_srvs::Trigger::Response &res)