33 #define PARAM_ENCODER_STRING "/encoder" 90 int emod = boost::lexical_cast<
unsigned int>(str_emode);
96 int motors = (emod - command) >> 4;
97 int tmp1 = ((motors & 0b1) > 0);
98 int tmp2 = ((motors & 0b10) > 0);
102 for (vector<roboteq::Motor*>::iterator it =
_motor.begin() ; it !=
_motor.end(); ++it)
115 for (vector<roboteq::Motor*>::iterator it =
_motor.begin() ; it !=
_motor.end(); ++it)
134 int ppr = boost::lexical_cast<
unsigned int>(str_ppr);
141 int ell = boost::lexical_cast<
unsigned int>(str_ell);
148 int ehl = boost::lexical_cast<
unsigned int>(str_ehl);
155 int home = boost::lexical_cast<
unsigned int>(str_home);
160 }
catch (std::bad_cast& e)
162 ROS_WARN_STREAM(
"Failure parsing feedback data. Dropping message." << e.what());
178 if(config.restore_defaults)
181 config.restore_defaults =
false;
186 if(config.load_roboteq)
190 config.load_roboteq =
false;
202 int configuration = config.configuration + 16*config.input_motor_one + 32*config.input_motor_two;
206 if(config.input_motor_one)
212 if(config.input_motor_two)
237 mSerial->
setParam(
"EHL", std::to_string(
mNumber) +
" " + std::to_string(config.encoder_high_count_limit));
bool setParam(string msg, string params="")
bool setup_encoder
Setup variable.
string mName
Associate name space.
void getEncoderFromRoboteq()
getEncoderFromRoboteq Load Encoder parameters from Roboteq board
void initConfigurator(bool load_from_board)
initConfigurator Initialize all parameter and syncronize parameters between ros and roboteq board ...
std::vector< roboteq::Motor * > _motor
double getConversion(double reduction)
getConversion Get conversion from pulse value to real value
ros::NodeHandle nh_
Private namespace.
void reconfigureCBEncoder(roboteq_control::RoboteqEncoderConfig &config, uint32_t level)
reconfigureCBEncoder when the dynamic reconfigurator change some values start this method ...
string getName()
getName the name of the motor
unsigned int mNumber
Number motor.
GPIOEncoderConfigurator(const ros::NodeHandle &nh, roboteq::serial_controller *serial, std::vector< roboteq::Motor * > motor, string name, unsigned int number)
GPIOEncoderConfigurator.
ROSLIB_DECL std::string command(const std::string &cmd)
const std::string & getNamespace() const
#define ROS_WARN_STREAM(args)
int getNumber()
getNumber The roboteq number
string getParam(string msg, string params="")
void registerSensor(GPIOSensor *sensor)
registerSensor register the sensor
#define PARAM_ENCODER_STRING
#define ROS_INFO_STREAM(args)
roboteq_control::RoboteqEncoderConfig _last_encoder_config
bool getParam(const std::string &key, std::string &s) const
dynamic_reconfigure::Server< roboteq_control::RoboteqEncoderConfig > * ds_encoder
Dynamic reconfigure encoder.
bool hasParam(const std::string &key) const
roboteq_control::RoboteqEncoderConfig default_encoder_config
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const
roboteq::serial_controller * mSerial
Serial port.