firmware.robstride_motors package¶
Submodules¶
firmware.robstride_motors.client module¶
RobStride Robot Client.
Adapted from the Robstride Python SDK here: https://github.com/sirwart/robstride.
- class firmware.robstride_motors.client.Client(bus, retry_count=2, recv_timeout=2, host_can_id=170)[source]¶
Bases:
object
- class firmware.robstride_motors.client.FeedbackResp(servo_id, errors, mode, angle, velocity, torque, temp)[source]¶
Bases:
object
-
angle:
float
¶
-
errors:
List
[MotorError
]¶
-
servo_id:
int
¶
-
temp:
float
¶
-
torque:
float
¶
-
velocity:
float
¶
-
angle:
- class firmware.robstride_motors.client.MotorError(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
- HallEncodingFault = 16¶
- MagneticEncodingFault = 8¶
- Overcurrent = 2¶
- Overtemp = 4¶
- Uncalibrated = 32¶
- Undervoltage = 1¶
- class firmware.robstride_motors.client.MotorMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
- Calibration = 1¶
- Reset = 0¶
- Run = 2¶
firmware.robstride_motors.model module¶
Defines the motor model but with Robstride motors instead.
TODO: Merge models into one generic model.
- class firmware.robstride_motors.model.Arm(rotator_cuff, shoulder, bicep, elbow, wrist, gripper)[source]¶
Bases:
object
-
bicep:
RobstrideMotor
¶
-
elbow:
RobstrideMotor
¶
-
gripper:
RobstrideMotor
¶
- property motor_ids: list[int]¶
- property motors: list[RobstrideMotor]¶
-
rotator_cuff:
RobstrideMotor
¶
-
shoulder:
RobstrideMotor
¶
-
wrist:
RobstrideMotor
¶
-
bicep:
- class firmware.robstride_motors.model.Body(left_arm=None, right_arm=None, left_leg=None, right_leg=None)[source]¶
Bases:
object
- property motor_ids: list[int]¶
- class firmware.robstride_motors.model.Leg(pelvis, hip, thigh, knee, ankle, foot)[source]¶
Bases:
object
-
ankle:
RobstrideMotor
¶
-
foot:
RobstrideMotor
¶
-
hip:
RobstrideMotor
¶
-
knee:
RobstrideMotor
¶
- property motor_ids: list[int]¶
- property motors: list[RobstrideMotor]¶
-
pelvis:
RobstrideMotor
¶
-
thigh:
RobstrideMotor
¶
-
ankle:
firmware.robstride_motors.motors module¶
Defines a class that dictates how to communicate with the motors.
Modified to work with Robstride motors. TODO: create a generic motor class that can work with any motor type.
- class firmware.robstride_motors.motors.RobstrideMotor(motor_id, control_params, client)[source]¶
Bases:
MotorInterface
A class to interface with a motor over a CAN bus.
- CALIBRATION_SPEED = 0.5¶
- calibrate(current_limit=10)[source]¶
Calibrates the motor assuming the existence of hard stops.
Args: current_limit: The current limit to use during calibration.
- Return type:
None
- get_current()[source]¶
Updates the value of the motor’s current attribute.
- Parameters:
wait_time – how long to wait for a response from the motor
read_only – whether to read the current value or not
- Return type:
float
- Returns:
“Valid” if the message is valid, “Invalid” otherwise
- get_position()[source]¶
Updates the value of the motor’s position attribute.
- Parameters:
wait_time – how long to wait for a response from the motor
read_only – whether to read the position value or not
- Return type:
float
- Returns:
“Valid” if the message is valid, “Invalid” otherwise
- get_speed()[source]¶
Updates the value of the motor’s speed attribute.
- Parameters:
wait_time – how long to wait for a response from the motor
read_only – whether to read the speed value or not
- Return type:
float
- Returns:
“Valid” if the message is valid, “Invalid” otherwise
- set_current(current)[source]¶
Sets the current of the motor.
Args: current: The current to set the motor to.
- Return type:
None
- set_operation_mode(mode)[source]¶
Sets the operation mode of the motor to position, speed, or current control!
- Parameters:
mode (
RunMode
) – The mode to set the motor to.- Return type:
None
- set_position(position, **kwargs)[source]¶
Sets the position of the motor using force position hybrid control.
- Parameters:
position (
float
) – The position to set the motor to.kwargs (
Any
) – Additional arguments to pass to the motor.
- Return type:
None
- class firmware.robstride_motors.motors.RobstrideParams(limit_torque, cur_kp, cur_ki, cur_fit_gain, limit_spd, limit_cur, loc_kp, spd_kp, spd_ki, spd_filt_gain)[source]¶
Bases:
MotorParams
-
cur_fit_gain:
float
¶
-
cur_ki:
float
¶
-
cur_kp:
float
¶
-
limit_cur:
float
¶
-
limit_spd:
float
¶
-
limit_torque:
float
¶
-
loc_kp:
float
¶
-
spd_filt_gain:
float
¶
-
spd_ki:
float
¶
-
spd_kp:
float
¶
-
cur_fit_gain: