54 #ifndef FASTRACK_TRACKING_TRACKER_H 55 #define FASTRACK_TRACKING_TRACKER_H 60 #include <fastrack_msgs/Control.h> 61 #include <fastrack_msgs/State.h> 64 #include <visualization_msgs/Marker.h> 65 #include <std_msgs/Empty.h> 70 template<
typename V,
typename TS,
typename TC,
typename PS,
71 typename SB,
typename SP>
106 typename SB::Request& req,
typename SB::Response& res) {
107 res =
value_.TrackingBound().ToRos();
111 typename SP::Request& req,
typename SP::Response& res) {
112 res =
value_.PlannerDynamics().ToRos();
122 ROS_WARN_THROTTLE(1.0,
"%s: Have not received planner/tracker state yet.",
185 template<
typename V,
typename TS,
typename TC,
186 typename PS,
typename SB,
typename SP>
188 name_ = ros::names::append(n.getNamespace(),
"Tracker");
191 if (!
value_.Initialize(n)) {
192 ROS_ERROR(
"%s: Failed to initialize value function.",
name_.c_str());
198 ROS_ERROR(
"%s: Failed to load parameters.",
name_.c_str());
204 ROS_ERROR(
"%s: Failed to register callbacks.",
name_.c_str());
213 template<
typename V,
typename TS,
typename TC,
214 typename PS,
typename SB,
typename SP>
216 ros::NodeHandle nl(n);
219 if (!nl.getParam(
"topic/ready",
ready_topic_))
return false;
223 if (!nl.getParam(
"vis/bound",
bound_topic_))
return false;
226 if (!nl.getParam(
"srv/bound",
bound_name_))
return false;
234 if (!nl.getParam(
"time_step",
time_step_))
return false;
240 template<
typename V,
typename TS,
typename TC,
241 typename PS,
typename SB,
typename SP>
243 ros::NodeHandle nl(n);
262 bound_pub_ = nl.advertise<visualization_msgs::Marker>(
ros::Subscriber planner_state_sub_
void PlannerStateCallback(const fastrack_msgs::State::ConstPtr &msg)
ros::Subscriber ready_sub_
ros::Publisher control_pub_
ros::ServiceServer planner_dynamics_srv_
bool Initialize(const ros::NodeHandle &n)
std::string planner_state_topic_
void TrackerStateCallback(const fastrack_msgs::State::ConstPtr &msg)
ros::Publisher bound_pub_
void TimerCallback(const ros::TimerEvent &e) const
std::string planner_frame_
bool LoadParameters(const ros::NodeHandle &n)
ros::Subscriber tracker_state_sub_
bool PlannerDynamicsServer(typename SP::Request &req, typename SP::Response &res)
void ReadyCallback(const std_msgs::Empty::ConstPtr &msg)
bool RegisterCallbacks(const ros::NodeHandle &n)
ros::ServiceServer bound_srv_
std::string planner_dynamics_name_
bool TrackingBoundServer(typename SB::Request &req, typename SB::Response &res)
std::string control_topic_
std::string tracker_state_topic_