31 #ifndef JOINT_TRAJECTORY_CONTROLLER_JOINT_TRAJECTORY_CONTROLLER_IMP_H 32 #define JOINT_TRAJECTORY_CONTROLLER_JOINT_TRAJECTORY_CONTROLLER_IMP_H 41 template <
class Enclosure,
class Member>
53 if (!nh.
getParam(param_name, xml_array))
56 return std::vector<std::string>();
58 if (xml_array.
getType() != XmlRpcValue::TypeArray)
60 ROS_ERROR_STREAM(
"The '" << param_name <<
"' parameter is not an array (namespace: " <<
62 return std::vector<std::string>();
65 std::vector<std::string> out;
66 for (
int i = 0; i < xml_array.
size(); ++i)
68 if (xml_array[i].getType() != XmlRpcValue::TypeString)
70 ROS_ERROR_STREAM(
"The '" << param_name <<
"' parameter contains a non-string element (namespace: " <<
72 return std::vector<std::string>();
74 out.push_back(static_cast<std::string>(xml_array[i]));
85 if (nh.
getParam(param_name, urdf_str))
87 if (!urdf->initString(urdf_str))
89 ROS_ERROR_STREAM(
"Failed to parse URDF contained in '" << param_name <<
"' parameter (namespace: " <<
91 return urdf::ModelSharedPtr();
95 else if (!urdf->initParam(
"robot_description"))
97 ROS_ERROR_STREAM(
"Failed to parse URDF contained in '" << param_name <<
"' parameter");
98 return urdf::ModelSharedPtr();
105 std::vector<urdf::JointConstSharedPtr> out;
106 for (
unsigned int i = 0; i < joint_names.size(); ++i)
108 urdf::JointConstSharedPtr urdf_joint = urdf.getJoint(joint_names[i]);
111 out.push_back(urdf_joint);
115 ROS_ERROR_STREAM(
"Could not find joint '" << joint_names[i] <<
"' in URDF model.");
116 return std::vector<urdf::JointConstSharedPtr>();
125 std::size_t
id = complete_ns.find_last_of(
"/");
126 return complete_ns.substr(
id + 1);
131 template <
class SegmentImpl,
class HardwareInterface>
137 time_data.time = time;
139 time_data_.initRT(time_data);
142 for (
unsigned int i = 0; i < joints_.size(); ++i)
144 desired_state_.position[i] = joints_[i].getPosition();
145 desired_state_.velocity[i] = joints_[i].getVelocity();
149 setHoldPosition(time_data.uptime);
152 last_state_publish_time_ = time_data.uptime;
155 hw_iface_adapter_.starting(time_data.uptime);
158 template <
class SegmentImpl,
class HardwareInterface>
165 template <
class SegmentImpl,
class HardwareInterface>
169 const bool update_ok = updateTrajectoryCommand(msg, RealtimeGoalHandlePtr());
170 if (update_ok) {preemptActiveGoal();}
173 template <
class SegmentImpl,
class HardwareInterface>
177 RealtimeGoalHandlePtr current_active_goal(rt_active_goal_);
180 if (current_active_goal)
183 rt_active_goal_.reset();
184 current_active_goal->gh_.setCanceled();
188 template <
class SegmentImpl,
class HardwareInterface>
192 hold_trajectory_ptr_(
new Trajectory)
199 "The joint_trajectory_controller verbose flag is enabled. " 200 <<
"This flag breaks real-time safety and should only be " 201 <<
"used for debugging");
205 template <
class SegmentImpl,
class HardwareInterface>
210 using namespace internal;
213 controller_nh_ = controller_nh;
219 double state_publish_rate = 50.0;
220 controller_nh_.getParam(
"state_publish_rate", state_publish_rate);
222 state_publisher_period_ =
ros::Duration(1.0 / state_publish_rate);
225 double action_monitor_rate = 20.0;
226 controller_nh_.getParam(
"action_monitor_rate", action_monitor_rate);
227 action_monitor_period_ =
ros::Duration(1.0 / action_monitor_rate);
228 ROS_DEBUG_STREAM_NAMED(name_,
"Action status changes will be monitored at " << action_monitor_rate <<
"Hz.");
231 stop_trajectory_duration_ = 0.0;
232 if (!controller_nh_.getParam(
"stop_trajectory_duration", stop_trajectory_duration_))
235 if (controller_nh_.getParam(
"hold_trajectory_duration", stop_trajectory_duration_))
237 ROS_WARN(
"The 'hold_trajectory_duration' has been deprecated in favor of the 'stop_trajectory_duration' parameter. Please update your controller configuration.");
243 controller_nh_.param<
bool>(
"allow_partial_joints_goal", allow_partial_joints_goal_,
false);
244 if (allow_partial_joints_goal_)
246 ROS_DEBUG_NAMED(name_,
"Goals with partial set of joints are allowed");
250 joint_names_ =
getStrings(controller_nh_,
"joints");
251 if (joint_names_.empty()) {
return false;}
252 const unsigned int n_joints = joint_names_.size();
255 urdf::ModelSharedPtr
urdf =
getUrdf(root_nh,
"robot_description");
256 if (!urdf) {
return false;}
258 std::vector<urdf::JointConstSharedPtr> urdf_joints =
getUrdfJoints(*urdf, joint_names_);
259 if (urdf_joints.empty()) {
return false;}
260 assert(n_joints == urdf_joints.size());
263 joints_.resize(n_joints);
264 angle_wraparound_.resize(n_joints);
265 for (
unsigned int i = 0; i < n_joints; ++i)
268 try {joints_[i] = hw->getHandle(joint_names_[i]);}
272 this->getHardwareInterfaceType() <<
"'.");
277 angle_wraparound_[i] = urdf_joints[i]->type == urdf::Joint::CONTINUOUS;
278 const std::string not_if = angle_wraparound_[i] ?
"" :
"non-";
280 ROS_DEBUG_STREAM_NAMED(name_,
"Found " << not_if <<
"continuous joint '" << joint_names_[i] <<
"' in '" <<
281 this->getHardwareInterfaceType() <<
"'.");
283 ROS_INFO_STREAM(
"Loading joint " << joint_names_[i] <<
" (" << i <<
")");
286 assert(joints_.size() == angle_wraparound_.size());
288 "\n- Number of joints: " << joints_.size() <<
289 "\n- Hardware interface type: '" << this->getHardwareInterfaceType() <<
"'" <<
290 "\n- Trajectory segment type: '" << hardware_interface::internal::demangledTypeName<SegmentImpl>() <<
"'");
294 default_tolerances_ = getSegmentTolerances<Scalar>(tol_nh, joint_names_);
297 hw_iface_adapter_.init(joints_, controller_nh_);
303 state_publisher_.reset(
new StatePublisher(controller_nh_,
"state", 1));
306 action_server_.reset(
new ActionServer(controller_nh_,
"follow_joint_trajectory",
310 action_server_->start();
313 query_state_service_ = controller_nh_.advertiseService(
"query_state",
318 current_state_ =
typename Segment::State(n_joints);
319 desired_state_ =
typename Segment::State(n_joints);
320 state_error_ =
typename Segment::State(n_joints);
321 desired_joint_state_ =
typename Segment::State(1);
322 state_joint_error_ =
typename Segment::State(1);
324 successful_joint_traj_ = boost::dynamic_bitset<>(joints_.size());
327 typename Segment::State current_joint_state_ =
typename Segment::State(1);
328 for (
unsigned int i = 0; i < n_joints; ++i)
330 current_joint_state_.position[0]= current_state_.position[i];
331 current_joint_state_.velocity[0]= current_state_.velocity[i];
332 Segment hold_segment(0.0, current_joint_state_, 0.0, current_joint_state_);
334 TrajectoryPerJoint joint_segment;
335 joint_segment.resize(1, hold_segment);
336 hold_trajectory_ptr_->push_back(joint_segment);
340 state_publisher_->lock();
341 state_publisher_->msg_.joint_names = joint_names_;
342 state_publisher_->msg_.desired.positions.resize(n_joints);
343 state_publisher_->msg_.desired.velocities.resize(n_joints);
344 state_publisher_->msg_.desired.accelerations.resize(n_joints);
345 state_publisher_->msg_.actual.positions.resize(n_joints);
346 state_publisher_->msg_.actual.velocities.resize(n_joints);
347 state_publisher_->msg_.error.positions.resize(n_joints);
348 state_publisher_->msg_.error.velocities.resize(n_joints);
349 state_publisher_->unlock();
355 if (controller_nh_.hasParam(
"mimic_joints"))
357 mimic_joint_names_ =
getStrings(controller_nh_,
"mimic_joints");
358 const unsigned int n_mimic_joints = mimic_joint_names_.size();
359 mimic_joints_.resize(n_mimic_joints);
360 mimic_joint_ids_.resize(n_mimic_joints);
361 mimic_urdf_joints_.resize(n_mimic_joints);
362 for (
unsigned int i = 0; i < n_mimic_joints; ++i)
366 mimic_joints_[i] = hw->hardware_interface::ResourceManager<JointHandle>::getHandle(mimic_joint_names_[i]);
371 this->getHardwareInterfaceType() <<
"'.");
374 mimic_urdf_joints_[i] = urdf->getJoint(mimic_joint_names_[i]);
375 if (!(mimic_urdf_joints_[i] && mimic_urdf_joints_[i]->mimic))
379 mimic_joint_ids_[i] = std::distance(joint_names_.begin(), std::find(joint_names_.begin(), joint_names_.end(), mimic_urdf_joints_[i]->mimic->joint_name));
380 if (mimic_joint_ids_[i] == joint_names_.size())
382 ROS_ERROR_STREAM_NAMED(name_,
"Could not find joint '" << mimic_urdf_joints_[i]->mimic->joint_name <<
"' in joint_names");
384 ROS_INFO_STREAM(
"Loading mimic_joint " << mimic_joint_names_[i] <<
" = " << joint_names_[mimic_joint_ids_[i]] <<
" (" << mimic_joint_ids_[i] <<
") * " << mimic_urdf_joints_[i]->mimic->multiplier <<
" + " << mimic_urdf_joints_[i]->mimic->offset);
387 mimic_hw_iface_adapter_.init(mimic_joints_, controller_nh_);
389 mimic_current_state_ =
typename Segment::State(n_mimic_joints);
390 mimic_desired_state_ =
typename Segment::State(n_mimic_joints);
391 mimic_state_error_ =
typename Segment::State(n_mimic_joints);
394 typename Segment::State mimic_current_joint_state_ =
typename Segment::State(1);
395 for (
unsigned int i = 0; i < n_mimic_joints; ++i)
397 mimic_current_joint_state_.position[0]= mimic_current_state_.position[i];
398 mimic_current_joint_state_.velocity[0]= mimic_current_state_.velocity[i];
405 template <
class SegmentImpl,
class HardwareInterface>
410 TrajectoryPtr curr_traj_ptr;
411 curr_trajectory_box_.get(curr_traj_ptr);
412 Trajectory& curr_traj = *curr_traj_ptr;
416 time_data.time = time;
417 time_data.period = period;
418 time_data.uptime = time_data_.readFromRT()->uptime + period;
419 time_data_.writeFromNonRT(time_data);
430 for (
unsigned int i = 0; i < joints_.size(); ++i)
432 current_state_.position[i] = joints_[i].getPosition();
433 current_state_.velocity[i] = joints_[i].getVelocity();
436 typename TrajectoryPerJoint::const_iterator segment_it =
sample(curr_traj[i], time_data.uptime.toSec(), desired_joint_state_);
437 if (curr_traj[i].end() == segment_it)
441 "Unexpected error: No trajectory defined at current time. Please contact the package maintainer.");
444 desired_state_.position[i] = desired_joint_state_.position[0];
445 desired_state_.velocity[i] = desired_joint_state_.velocity[0];
446 desired_state_.acceleration[i] = desired_joint_state_.acceleration[0]; ;
449 state_joint_error_.velocity[0] = desired_joint_state_.velocity[0] - current_state_.velocity[i];
450 state_joint_error_.acceleration[0] = 0.0;
453 state_error_.velocity[i] = desired_joint_state_.velocity[0] - current_state_.velocity[i];
454 state_error_.acceleration[i] = 0.0;
457 const RealtimeGoalHandlePtr rt_segment_goal = segment_it->getGoalHandle();
458 if (rt_segment_goal && rt_segment_goal == rt_active_goal_)
461 if (time_data.uptime.toSec() < segment_it->endTime())
472 rt_segment_goal->preallocated_result_->error_code =
473 control_msgs::FollowJointTrajectoryResult::PATH_TOLERANCE_VIOLATED;
474 rt_segment_goal->setAborted(rt_segment_goal->preallocated_result_);
475 rt_active_goal_.reset();
476 successful_joint_traj_.reset();
479 else if (segment_it == --curr_traj[i].end())
485 const ros::Time uptime = time_data_.readFromRT()->uptime;
491 if (inside_goal_tolerances)
493 successful_joint_traj_[i] = 1;
508 rt_segment_goal->preallocated_result_->error_code = control_msgs::FollowJointTrajectoryResult::GOAL_TOLERANCE_VIOLATED;
509 rt_segment_goal->setAborted(rt_segment_goal->preallocated_result_);
510 rt_active_goal_.reset();
511 successful_joint_traj_.reset();
518 RealtimeGoalHandlePtr current_active_goal(rt_active_goal_);
519 if (current_active_goal and successful_joint_traj_.count() == joints_.size())
521 current_active_goal->preallocated_result_->error_code = control_msgs::FollowJointTrajectoryResult::SUCCESSFUL;
522 current_active_goal->setSucceeded(current_active_goal->preallocated_result_);
523 current_active_goal.reset();
524 rt_active_goal_.reset();
525 successful_joint_traj_.reset();
529 hw_iface_adapter_.updateCommand(time_data.uptime, time_data.period,
530 desired_state_, state_error_);
533 if (current_active_goal)
535 current_active_goal->preallocated_feedback_->header.stamp = time_data_.readFromRT()->time;
536 current_active_goal->preallocated_feedback_->desired.positions = desired_state_.position;
537 current_active_goal->preallocated_feedback_->desired.velocities = desired_state_.velocity;
538 current_active_goal->preallocated_feedback_->desired.accelerations = desired_state_.acceleration;
539 current_active_goal->preallocated_feedback_->actual.positions = current_state_.position;
540 current_active_goal->preallocated_feedback_->actual.velocities = current_state_.velocity;
541 current_active_goal->preallocated_feedback_->error.positions = state_error_.position;
542 current_active_goal->preallocated_feedback_->error.velocities = state_error_.velocity;
543 current_active_goal->setFeedback( current_active_goal->preallocated_feedback_ );
547 publishState(time_data.uptime);
551 for (
unsigned int i = 0; i < mimic_joints_.size(); ++i)
553 mimic_current_state_.position[i] = mimic_joints_[i].getPosition();
554 mimic_current_state_.velocity[i] = mimic_joints_[i].getVelocity();
557 unsigned int mimic_joint_id = mimic_joint_ids_[i];
558 mimic_desired_state_.position[i] = desired_state_.position[mimic_joint_id] * mimic_urdf_joints_[i]->mimic->multiplier + mimic_urdf_joints_[i]->mimic->offset;
559 mimic_desired_state_.velocity[i] = desired_state_.velocity[mimic_joint_id];
560 mimic_desired_state_.acceleration[i] = desired_state_.acceleration[mimic_joint_id];
563 mimic_state_error_.velocity[i] = mimic_desired_state_.velocity[i] - mimic_current_state_.velocity[i];
564 mimic_state_error_.acceleration[i] = 0.0;
568 if (mimic_joints_.size() > 0)
570 mimic_hw_iface_adapter_.updateCommand(time_data.uptime, time_data.period,
571 mimic_desired_state_, mimic_state_error_);
576 template <
class SegmentImpl,
class HardwareInterface>
578 updateTrajectoryCommand(
const JointTrajectoryConstPtr& msg, RealtimeGoalHandlePtr gh, std::string* error_string)
582 options.error_string = error_string;
583 std::string error_string_tmp;
586 if (!this->isRunning())
588 error_string_tmp =
"Can't accept new commands. Controller is not running.";
590 options.setErrorString(error_string_tmp);
596 error_string_tmp =
"Received null-pointer trajectory message, skipping.";
598 options.setErrorString(error_string_tmp);
603 TimeData* time_data = time_data_.readFromRT();
606 const ros::Time next_update_time = time_data->time + time_data->period;
609 ros::Time next_update_uptime = time_data->uptime + time_data->period;
612 if (msg->points.empty())
614 setHoldPosition(time_data->uptime, gh);
620 TrajectoryPtr curr_traj_ptr;
621 curr_trajectory_box_.get(curr_traj_ptr);
623 options.other_time_base = &next_update_uptime;
624 options.current_trajectory = curr_traj_ptr.get();
625 options.joint_names = &joint_names_;
626 options.angle_wraparound = &angle_wraparound_;
627 options.rt_goal_handle = gh;
628 options.default_tolerances = &default_tolerances_;
629 options.allow_partial_joints_goal = allow_partial_joints_goal_;
634 TrajectoryPtr traj_ptr(
new Trajectory);
635 *traj_ptr = initJointTrajectory<Trajectory>(*msg, next_update_time, options);
636 if (!traj_ptr->empty())
638 curr_trajectory_box_.set(traj_ptr);
645 catch(
const std::invalid_argument& ex)
648 options.setErrorString(ex.what());
653 error_string_tmp =
"Unexpected exception caught when initializing trajectory from ROS message data.";
655 options.setErrorString(error_string_tmp);
662 template <
class SegmentImpl,
class HardwareInterface>
669 if (!this->isRunning())
671 ROS_ERROR_NAMED(name_,
"Can't accept new action goals. Controller is not running.");
672 control_msgs::FollowJointTrajectoryResult result;
673 result.error_code = control_msgs::FollowJointTrajectoryResult::INVALID_GOAL;
674 gh.setRejected(result);
679 if (!allow_partial_joints_goal_)
681 if (gh.getGoal()->trajectory.joint_names.size() != joint_names_.size())
683 ROS_ERROR_NAMED(name_,
"Joints on incoming goal don't match the controller joints.");
684 control_msgs::FollowJointTrajectoryResult result;
685 result.error_code = control_msgs::FollowJointTrajectoryResult::INVALID_JOINTS;
686 gh.setRejected(result);
693 std::vector<unsigned int> mapping_vector =
mapping(gh.getGoal()->trajectory.joint_names, joint_names_);
695 if (mapping_vector.empty())
697 ROS_ERROR_NAMED(name_,
"Joints on incoming goal don't match the controller joints.");
698 control_msgs::FollowJointTrajectoryResult result;
699 result.error_code = control_msgs::FollowJointTrajectoryResult::INVALID_JOINTS;
700 gh.setRejected(result);
705 RealtimeGoalHandlePtr rt_goal(
new RealtimeGoalHandle(gh));
706 std::string error_string;
707 const bool update_ok = updateTrajectoryCommand(
internal::share_member(gh.getGoal(), gh.getGoal()->trajectory),
710 rt_goal->preallocated_feedback_->joint_names = joint_names_;
717 rt_active_goal_ = rt_goal;
720 goal_handle_timer_ = controller_nh_.createTimer(action_monitor_period_,
721 &RealtimeGoalHandle::runNonRealtime,
723 goal_handle_timer_.start();
728 control_msgs::FollowJointTrajectoryResult result;
729 result.error_code = control_msgs::FollowJointTrajectoryResult::INVALID_GOAL;
730 result.error_string = error_string;
731 gh.setRejected(result);
735 template <
class SegmentImpl,
class HardwareInterface>
739 RealtimeGoalHandlePtr current_active_goal(rt_active_goal_);
742 if (current_active_goal && current_active_goal->gh_ == gh)
745 rt_active_goal_.reset();
748 const ros::Time uptime = time_data_.readFromRT()->uptime;
751 setHoldPosition(uptime);
752 ROS_DEBUG_NAMED(name_,
"Canceling active action goal because cancel callback recieved from actionlib.");
755 current_active_goal->gh_.setCanceled();
759 template <
class SegmentImpl,
class HardwareInterface>
762 control_msgs::QueryTrajectoryState::Response&
resp)
765 if (!this->isRunning())
767 ROS_ERROR_NAMED(name_,
"Can't sample trajectory. Controller is not running.");
772 TimeData* time_data = time_data_.readFromRT();
773 const ros::Duration time_offset = req.time - time_data->time;
774 const ros::Time sample_time = time_data->uptime + time_offset;
777 TrajectoryPtr curr_traj_ptr;
778 curr_trajectory_box_.get(curr_traj_ptr);
779 Trajectory& curr_traj = *curr_traj_ptr;
781 typename Segment::State response_point =
typename Segment::State(joint_names_.size());
783 for (
unsigned int i = 0; i < joints_.size(); ++i)
785 typename Segment::State state;
786 typename TrajectoryPerJoint::const_iterator segment_it =
sample(curr_traj[i], sample_time.
toSec(), state);
787 if (curr_traj[i].end() == segment_it)
793 response_point.position[i] = state.position[0];
794 response_point.velocity[i] = state.velocity[0];
795 response_point.acceleration[i] = state.acceleration[0];
799 resp.name = joint_names_;
800 resp.position = response_point.position;
801 resp.velocity = response_point.velocity;
802 resp.acceleration = response_point.acceleration;
807 template <
class SegmentImpl,
class HardwareInterface>
812 if (!state_publisher_period_.isZero() && last_state_publish_time_ + state_publisher_period_ < time)
814 if (state_publisher_ && state_publisher_->trylock())
816 last_state_publish_time_ += state_publisher_period_;
818 state_publisher_->msg_.header.stamp = time_data_.readFromRT()->time;
819 state_publisher_->msg_.desired.positions = desired_state_.position;
820 state_publisher_->msg_.desired.velocities = desired_state_.velocity;
821 state_publisher_->msg_.desired.accelerations = desired_state_.acceleration;
822 state_publisher_->msg_.actual.positions = current_state_.position;
823 state_publisher_->msg_.actual.velocities = current_state_.velocity;
824 state_publisher_->msg_.error.positions = state_error_.position;
825 state_publisher_->msg_.error.velocities = state_error_.velocity;
827 state_publisher_->unlockAndPublish();
832 template <
class SegmentImpl,
class HardwareInterface>
836 assert(joint_names_.size() == hold_trajectory_ptr_->size());
838 typename Segment::State hold_start_state_ =
typename Segment::State(1);
839 typename Segment::State hold_end_state_ =
typename Segment::State(1);
840 const unsigned int n_joints = joints_.size();
841 const typename Segment::Time start_time = time.
toSec();
843 if(stop_trajectory_duration_ == 0.0)
846 for (
unsigned int i = 0; i < n_joints; ++i)
848 hold_start_state_.position[0] = joints_[i].getPosition();
849 hold_start_state_.velocity[0] = 0.0;
850 hold_start_state_.acceleration[0] = 0.0;
851 (*hold_trajectory_ptr_)[i].front().init(start_time, hold_start_state_,
852 start_time, hold_start_state_);
854 (*hold_trajectory_ptr_)[i].front().setGoalHandle(gh);
865 const typename Segment::Time end_time = time.
toSec() + stop_trajectory_duration_;
866 const typename Segment::Time end_time_2x = time.
toSec() + 2.0 * stop_trajectory_duration_;
869 for (
unsigned int i = 0; i < n_joints; ++i)
873 hold_start_state_.position[0] = desired_state_.position[i];
874 hold_start_state_.velocity[0] = desired_state_.velocity[i];
875 hold_start_state_.acceleration[0] = 0.0;
877 hold_end_state_.position[0] = desired_state_.position[i];
878 hold_end_state_.velocity[0] = -desired_state_.velocity[i];
879 hold_end_state_.acceleration[0] = 0.0;
881 (*hold_trajectory_ptr_)[i].front().init(start_time, hold_start_state_,
882 end_time_2x, hold_end_state_);
885 (*hold_trajectory_ptr_)[i].front().sample(end_time, hold_end_state_);
888 (*hold_trajectory_ptr_)[i].front().init(start_time, hold_start_state_,
889 end_time, hold_end_state_);
892 (*hold_trajectory_ptr_)[i].front().setGoalHandle(gh);
895 curr_trajectory_box_.set(hold_trajectory_ptr_);
900 #endif // header guard
StateTolerances< Scalar > state_tolerance
#define ROS_DEBUG_STREAM_NAMED(name, args)
#define ROS_ERROR_STREAM_NAMED(name, args)
virtual void cancelCB(GoalHandle gh)
Trajectory::const_iterator sample(const Trajectory &trajectory, const typename Trajectory::value_type::Time &time, typename Trajectory::value_type::State &state)
#define ROS_DEBUG_STREAM_THROTTLE_NAMED(rate, name, args)
JointTrajectoryController()
Type const & getType() const
void update(const ros::Time &time, const ros::Duration &period)
void starting(const ros::Time &time)
std::vector< urdf::JointConstSharedPtr > getUrdfJoints(const urdf::Model &urdf, const std::vector< std::string > &joint_names)
virtual void trajectoryCommandCB(const JointTrajectoryConstPtr &msg)
bool checkStateTolerancePerJoint(const State &state_error, const StateTolerances< typename State::Scalar > &state_tolerance, bool show_errors=false)
#define ROS_DEBUG_NAMED(name,...)
void setHoldPosition(const ros::Time &time, RealtimeGoalHandlePtr gh=RealtimeGoalHandlePtr())
Scalar goal_time_tolerance
void publishState(const ros::Time &time)
virtual void goalCB(GoalHandle gh)
StateTolerances< Scalar > goal_state_tolerance
const std::string & getNamespace() const
bool init(HardwareInterface *hw, ros::NodeHandle &root_nh, ros::NodeHandle &controller_nh)
#define ROS_WARN_STREAM(args)
virtual void preemptActiveGoal()
virtual bool updateTrajectoryCommand(const JointTrajectoryConstPtr &msg, RealtimeGoalHandlePtr gh, std::string *error_string=0)
virtual bool queryStateService(control_msgs::QueryTrajectoryState::Request &req, control_msgs::QueryTrajectoryState::Response &resp)
std::vector< unsigned int > mapping(const T &t1, const T &t2)
#define ROS_INFO_STREAM(args)
void stopping(const ros::Time &)
bool getParam(const std::string &key, std::string &s) const
#define ROS_ERROR_NAMED(name,...)
boost::shared_ptr< Member > share_member(boost::shared_ptr< Enclosure > enclosure, Member &member)
urdf::ModelSharedPtr getUrdf(const ros::NodeHandle &nh, const std::string ¶m_name)
#define ROS_ERROR_STREAM(args)
std::string getLeafNamespace(const ros::NodeHandle &nh)
std::vector< std::string > getStrings(const ros::NodeHandle &nh, const std::string ¶m_name)
def shortest_angular_distance(from_angle, to_angle)
#define ROS_WARN_STREAM_NAMED(name, args)