@@ -341,6 +341,13 @@ KortexMultiInterfaceHardware::export_command_interfaces()
341
341
{
342
342
command_interfaces.emplace_back (hardware_interface::CommandInterface (
343
343
info_.joints [i].name , hardware_interface::HW_IF_POSITION, &gripper_command_position_));
344
+
345
+ command_interfaces.emplace_back (hardware_interface::CommandInterface (
346
+ info_.joints [i].name , " set_gripper_max_velocity" , &gripper_speed_command_));
347
+ gripper_speed_command_ = gripper_command_max_velocity_;
348
+ command_interfaces.emplace_back (hardware_interface::CommandInterface (
349
+ info_.joints [i].name , " set_gripper_max_effort" , &gripper_force_command_));
350
+ gripper_force_command_ = gripper_command_max_force_;
344
351
}
345
352
else
346
353
{
@@ -671,9 +678,9 @@ CallbackReturn KortexMultiInterfaceHardware::on_activate(
671
678
base_command_.mutable_interconnect ()->mutable_command_id ()->set_identifier (0 );
672
679
gripper_motor_command_ =
673
680
base_command_.mutable_interconnect ()->mutable_gripper_command ()->add_motor_cmd ();
674
- gripper_motor_command_->set_position (gripper_initial_position); // % position
675
- gripper_motor_command_->set_velocity (gripper_command_max_velocity_); // % speed
676
- gripper_motor_command_->set_force (gripper_command_max_force_ ); // % torque
681
+ gripper_motor_command_->set_position (gripper_initial_position); // % position
682
+ gripper_motor_command_->set_velocity (gripper_speed_command_); // % speed
683
+ gripper_motor_command_->set_force (gripper_force_command_ ); // % force
677
684
678
685
// Send a first frame
679
686
base_feedback = base_cyclic_.Refresh (base_command_);
@@ -864,8 +871,7 @@ return_type KortexMultiInterfaceHardware::write(
864
871
865
872
// gripper control
866
873
sendGripperCommand (
867
- arm_mode_, gripper_command_position_, gripper_command_max_velocity_,
868
- gripper_command_max_force_);
874
+ arm_mode_, gripper_command_position_, gripper_speed_command_, gripper_force_command_);
869
875
// read after write in twist mode
870
876
feedback_ = base_cyclic_.RefreshFeedback ();
871
877
}
@@ -877,8 +883,7 @@ return_type KortexMultiInterfaceHardware::write(
877
883
878
884
// gripper control
879
885
sendGripperCommand (
880
- arm_mode_, gripper_command_position_, gripper_command_max_velocity_,
881
- gripper_command_max_force_);
886
+ arm_mode_, gripper_command_position_, gripper_speed_command_, gripper_force_command_);
882
887
883
888
if (joint_based_controller_running_)
884
889
{
0 commit comments