Skip to content
Snippets Groups Projects
Commit 552aca9b authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved a bug in the set_punch() function: the register address was written...

Solved a bug in the set_punch() function: the register address was written instead of the actual value.
Chnaged the control mode depending on the parameters of the set_position_range() function.
parent 702c672f
No related branches found
No related tags found
No related merge requests found
......@@ -479,6 +479,10 @@ void CDynamixelMotor::set_position_range(double min, double max)
usleep(10000);
this->dynamixel_dev->write_word_register(this->registers[cw_angle_limit],min_pos);
usleep(10000);
if(this->config.min_angle==-this->info.center_angle && this->config.max_angle==-this->info.center_angle)
this->mode=torque_ctrl;
else
this->mode=angle_ctrl;
}catch(CDynamixelAlarmException &e){
/* handle dynamixel exception */
if(e.get_alarm()&this->alarms)
......@@ -1364,10 +1368,10 @@ void CDynamixelMotor::set_punch(unsigned short int punch_value)
else
{
try{
if(punch<0x0020 || punch>0x03FF)
if(punch_value<0x0020 || punch_value>0x03FF)
throw CDynamixelMotorException(_HERE_,"Invalid Punch value");
this->config.punch=punch;
this->dynamixel_dev->write_word_register(this->registers[punch],punch);
this->config.punch=punch_value;
this->dynamixel_dev->write_word_register(this->registers[punch],punch_value);
}catch(CDynamixelAlarmException &e){
/* handle dynamixel exception */
if(e.get_alarm()&this->alarms)
......
<?xml version="1.0"?>
<dyn_server_ftdi_config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="dyn_motor_group_cfg_file.xsd">
<serial_num>A400gavq</serial_num>
<baudrate>1000000</baudrate>
</dyn_server_ftdi_config>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment