18 #ifndef H_GEOM_CONTROLLER_IMPL 19 #define H_GEOM_CONTROLLER_IMPL 23 #include <boost/scoped_ptr.hpp> 33 boost::scoped_ptr<Controller>
geom_;
38 for (
unsigned i=0; i<wheel_states_.size(); i++){
39 wheel_states_[i].dAngGearSteerRad = steer_joints_[i].getPosition();
40 wheel_states_[i].dVelGearSteerRadS = steer_joints_[i].getVelocity();
41 wheel_states_[i].dVelGearDriveRadS = drive_joints_[i].getVelocity();
43 geom_->updateWheelStates(wheel_states_);
46 bool setup(
const std::vector<typename Controller::WheelParams> &wheel_params){
47 if (wheel_params.size() < 3){
48 ROS_ERROR(
"At least three wheel are needed.");
51 wheel_states_.resize(wheel_params.size());
52 geom_.reset(
new Controller(wheel_params));
64 std::vector<typename Controller::WheelParams> wheel_params;
66 return init(hw, wheel_params);
68 bool init(Interface* hw,
const wheel_params_t & wheel_params){
69 if(!this->
setup(wheel_params))
return false;
71 for (
unsigned i=0; i<wheel_params.size(); i++){
72 this->
steer_joints_.push_back(hw->getHandle(wheel_params[i].geom.steer_name));
73 this->
drive_joints_.push_back(hw->getHandle(wheel_params[i].geom.drive_name));
76 catch(
const std::exception &e){
std::vector< typename Controller::WheelParams > wheel_params_t
bool parseWheelParams(std::vector< UndercarriageGeom::WheelParams > ¶ms, const ros::NodeHandle &nh, bool read_urdf=true)
boost::scoped_ptr< Controller > geom_
std::vector< HandleType > steer_joints_
std::vector< HandleType > drive_joints_
bool setup(const std::vector< typename Controller::WheelParams > &wheel_params)
std::vector< WheelState > wheel_states_
bool init(Interface *hw, const wheel_params_t &wheel_params)
bool init(Interface *hw, ros::NodeHandle &controller_nh)
#define ROS_ERROR_STREAM(args)