21 #include <dynamic_reconfigure/server.h> 22 #include <cob_omni_drive_controller/SteerCtrlConfig.h> 37 return setup(root_nh, controller_nh);
56 boost::recursive_mutex::scoped_try_lock lock(
mutex);
63 boost::recursive_mutex::scoped_lock lock(
mutex);
70 SteerCtrlConfig config;
71 copy(config, params.front().pos_ctrl);
77 SteerCtrlConfig config;
78 copy(config, params[i].pos_ctrl);
79 dr->setConfigDefault(config);
80 dr->updateConfig(config);
88 params.
dDamp = config.damp;
89 params.
dVirtM = config.virt_mass;
95 config.damp = params.
dDamp;
96 config.virt_mass = params.
dVirtM;
102 ROS_INFO(
"configure all steers: s: %lf, d: %lf, m: %lf, v: %lf, a: %lf", config.spring, config.damp, config.virt_mass, config.d_phi_max, config.dd_phi_max);
112 void setForOne(
size_t i, SteerCtrlConfig &config, uint32_t ) {
113 ROS_INFO(
"configure steer %d: s: %lf, d: %lf, m: %lf, v: %lf, a: %lf", (
int)i, config.spring, config.damp, config.virt_mass, config.d_phi_max, config.dd_phi_max);
std::vector< typename UndercarriageCtrl::WheelParams > wheel_params_t
void setForOne(size_t i, SteerCtrlConfig &config, uint32_t)
bool parseWheelParams(std::vector< UndercarriageGeom::WheelParams > ¶ms, const ros::NodeHandle &nh, bool read_urdf=true)
boost::scoped_ptr< UndercarriageCtrl > geom_
bool setup(ros::NodeHandle &root_nh, ros::NodeHandle &controller_nh)
boost::scoped_ptr< dynamic_reconfigure::Server< SteerCtrlConfig > > reconfigure_server_
virtual void update(const ros::Time &time, const ros::Duration &period)
std::vector< hardware_interface::VelocityJointInterface::ResourceHandleType > steer_joints_
static void copy(PosCtrlParams ¶ms, const SteerCtrlConfig &config)
void setForAll(SteerCtrlConfig &config, uint32_t)
std::vector< hardware_interface::VelocityJointInterface::ResourceHandleType > drive_joints_
void init(const wheel_params_t ¶ms, const ros::NodeHandle &nh)
std::vector< PosCtrlParams > pos_ctrl_params
void configure(const std::vector< PosCtrlParams > &pos_ctrl)
boost::recursive_mutex mutex
class cob_omni_drive_controller::WheelController::PosCtrl pos_ctrl_
std::vector< boost::shared_ptr< dynamic_reconfigure::Server< SteerCtrlConfig > > > reconfigure_server_axes_
bool init(Interface *hw, ros::NodeHandle &controller_nh)
void try_configure(UndercarriageCtrl &ctrl)
std::vector< WheelCommand > wheel_commands_
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
virtual bool init(hardware_interface::VelocityJointInterface *hw, ros::NodeHandle &root_nh, ros::NodeHandle &controller_nh)
static void copy(SteerCtrlConfig &config, const PosCtrlParams ¶ms)
void updateCtrl(const ros::Time &time, const ros::Duration &period)