@@ -102,7 +102,7 @@ CallbackReturn DynamixelHardware::on_init(const hardware_interface::HardwareInfo
102
102
}
103
103
104
104
enable_torque (false );
105
- set_control_mode (ControlMode::Position , true );
105
+ set_control_mode (ControlMode::ExtendedPosition , true );
106
106
set_joint_params ();
107
107
enable_torque (true );
108
108
@@ -305,7 +305,7 @@ return_type DynamixelHardware::write(const rclcpp::Time & /* time */, const rclc
305
305
// Position control
306
306
if (std::any_of (
307
307
joints_.cbegin (), joints_.cend (), [](auto j) { return j.command .position != j.prev_command .position ; })) {
308
- set_control_mode (ControlMode::Position );
308
+ set_control_mode (ControlMode::ExtendedPosition );
309
309
if (mode_changed_)
310
310
{
311
311
set_joint_params ();
@@ -327,7 +327,7 @@ return_type DynamixelHardware::write(const rclcpp::Time & /* time */, const rclc
327
327
set_joint_velocities ();
328
328
return return_type::OK;
329
329
break ;
330
- case ControlMode::Position :
330
+ case ControlMode::ExtendedPosition :
331
331
set_joint_positions ();
332
332
return return_type::OK;
333
333
break ;
@@ -396,23 +396,23 @@ return_type DynamixelHardware::set_control_mode(const ControlMode & mode, const
396
396
return return_type::OK;
397
397
}
398
398
399
- if (mode == ControlMode::Position && (force_set || control_mode_ != ControlMode::Position )) {
399
+ if (mode == ControlMode::ExtendedPosition && (force_set || control_mode_ != ControlMode::ExtendedPosition )) {
400
400
bool torque_enabled = torque_enabled_;
401
401
if (torque_enabled) {
402
402
enable_torque (false );
403
403
}
404
404
405
405
for (uint i = 0 ; i < joint_ids_.size (); ++i) {
406
- if (!dynamixel_workbench_.setPositionControlMode (joint_ids_[i], &log)) {
406
+ if (!dynamixel_workbench_.setExtendedPositionControlMode (joint_ids_[i], &log)) {
407
407
RCLCPP_FATAL (rclcpp::get_logger (kDynamixelHardware ), " %s" , log);
408
408
return return_type::ERROR;
409
409
}
410
410
}
411
411
RCLCPP_INFO (rclcpp::get_logger (kDynamixelHardware ), " Position control" );
412
- if (control_mode_ != ControlMode::Position )
412
+ if (control_mode_ != ControlMode::ExtendedPosition )
413
413
{
414
414
mode_changed_ = true ;
415
- control_mode_ = ControlMode::Position ;
415
+ control_mode_ = ControlMode::ExtendedPosition ;
416
416
}
417
417
418
418
if (torque_enabled) {
@@ -421,7 +421,7 @@ return_type DynamixelHardware::set_control_mode(const ControlMode & mode, const
421
421
return return_type::OK;
422
422
}
423
423
424
- if (control_mode_ != ControlMode::Velocity && control_mode_ != ControlMode::Position ) {
424
+ if (control_mode_ != ControlMode::Velocity && control_mode_ != ControlMode::ExtendedPosition ) {
425
425
RCLCPP_FATAL (
426
426
rclcpp::get_logger (kDynamixelHardware ), " Only position/velocity control are implemented" );
427
427
return return_type::ERROR;
0 commit comments