4 : action_name_(server_name),
6 private_nh_(private_nh),
7 perception_(private_nh),
8 move_base_client_(
"move_base", true),
9 actionlib::ActionServer<caster_app::DockAction>(private_nh, server_name,
21 ROS_INFO_STREAM(
"param: dock_spped " << dock_speed_ <<
", dock_distance " << dock_distance_);
22 ROS_INFO_STREAM(
"param: map_frame " << map_frame_ <<
", odom_frame " << odom_frame_ <<
", base_frame " << base_frame_);
36 ROS_INFO(
"waitting for move_base action server...");
38 ROS_INFO(
"move_base action server connected.");
47 geometry_msgs::Twist
cmd;
81 feedback_.dock_feedback =
"Stop on DockReady";
98 geometry_msgs::Twist
cmd;
132 feedback_.dock_feedback =
"Stop on Dock";
145 move_base_msgs::MoveBaseGoal mb_goal;
147 mb_goal.target_pose.header.frame_id =
map_frame_;
159 caster_app::DockFeedback feedback;
160 feedback.dock_feedback =
"DockReady arrived";
182 caster_app::DockFeedback ca_feedback;
183 ca_feedback.dock_feedback = boost::str(boost::format(
"Moving to DockReady, %dm left") % dock_ready_pos.
distance(robot_pose.
getOrigin()));
195 ROS_WARN(
"rejected, robot has already docked");
231 ROS_WARN(
"rejected, robot is not on charging");
const char *const *argv double delta
void publishFeedback(const Feedback &feedback)
void publish(const boost::shared_ptr< M > &message) const
#define ROS_WARN_NAMED(name,...)
void MovebaseFeedbackCallback(const move_base_msgs::MoveBaseFeedbackConstPtr &feedback)
caster_app::DockFeedback feedback_
void GoalCallback(GoalHandle gh)
void CancelCallback(GoalHandle gh)
void setRejected(const Result &result=Result(), const std::string &text=std::string(""))
boost::shared_ptr< const Goal > getGoal() const
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
void setAccepted(const std::string &text=std::string(""))
boost::function< void()> SimpleActiveCallback
actionlib::SimpleActionClient< move_base_msgs::MoveBaseAction > move_base_client_
ros::NodeHandle private_nh_
void setSucceeded(const Result &result=Result(), const std::string &text=std::string(""))
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void sendGoal(const Goal &goal, SimpleDoneCallback done_cb=SimpleDoneCallback(), SimpleActiveCallback active_cb=SimpleActiveCallback(), SimpleFeedbackCallback feedback_cb=SimpleFeedbackCallback())
tf::TransformListener tf_listener_
#define ROS_INFO_STREAM(args)
geometry_msgs::Pose dock_ready_pose_
void MovebaseDoneCallback(const actionlib::SimpleClientGoalState &state, const move_base_msgs::MoveBaseResultConstPtr &result)
DockServer(ros::NodeHandle &nh, ros::NodeHandle &private_nh, const std::string &server_name)
ROSCPP_DECL void spinOnce()