29 #include "twist_controller/TwistControllerConfig.h" 36 if (!n.
getParam(
"frame_id", frame_id))
43 server_.reset(
new dynamic_reconfigure::Server<twist_controller::TwistControllerConfig>(n));
46 handle_ = hw->getHandle(frame_id);
49 std::vector<std::string> joint_names;
50 if (!n.
getParam(
"joints", joint_names))
56 for (
auto& name : joint_names)
66 geometry_msgs::Twist twist;
78 geometry_msgs::Twist twist;
79 twist.linear.x =
gain_ * msg->linear.x;
80 twist.linear.y =
gain_ * msg->linear.y;
81 twist.linear.z =
gain_ * msg->linear.z;
82 twist.angular.x =
gain_ * msg->angular.x;
83 twist.angular.y =
gain_ * msg->angular.y;
84 twist.angular.z =
gain_ * msg->angular.z;
90 gain_ = config.twist_gain;
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
virtual void starting(const ros::Time &time) override
realtime_tools::RealtimeBuffer< geometry_msgs::Twist > command_buffer_
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
bool getParam(const std::string &key, std::string &s) const
std::string resolveName(const std::string &name, bool remap=true) const
std::shared_ptr< dynamic_reconfigure::Server< twist_controller::TwistControllerConfig > > server_
virtual bool init(TwistCommandInterface *hw, ros::NodeHandle &n) override
A Cartesian ROS-controller for commanding target twists to a robot.
void reconfigureCallback(const twist_controller::TwistControllerConfig &config, uint32_t level)
#define ROS_ERROR_STREAM(args)
void twistCallback(const geometry_msgs::TwistConstPtr &msg)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
ros::Subscriber twist_sub_
TwistCommandHandle handle_