Skip to content

Commit

Permalink
Add target_torque management on motor profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-rabault committed Aug 1, 2024
1 parent e42e024 commit 41bd12e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions engine/profiles/servo_motor/profile_servo_motor.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ void ProfileServo_Handler(service_t *service, const msg_t *msg)
}
}
break;
case TORQUE:
{
// set the motor target torque
if (servo_motor_profile->mode.mode_torque)
{
ForceOD_TorqueFromMsg((torque_t *)&servo_motor_profile->target_torque, msg);
}
}
case LINEAR_POSITION:
{
// set the motor target linear position
Expand Down
1 change: 1 addition & 0 deletions engine/profiles/servo_motor/profile_servo_motor.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ typedef struct
servo_motor_mode_t mode;
angular_position_t target_angular_position;
angular_speed_t target_angular_speed;
torque_t target_torque;

// limits
angular_position_t limit_angular_position[2];
Expand Down

0 comments on commit 41bd12e

Please sign in to comment.