feathersdk.robot.navigation_platform Module¶
- exception feathersdk.robot.navigation_platform.NavigationMotorError¶
Bases:
ExceptionException raised when motor errors are detected during navigation commands.
- class feathersdk.robot.navigation_platform.ThreeWheelServeDrivePlatform(motors_manager: MotorsManager, config: dict, power: BatterySystem = None)¶
Bases:
SteppableSystem- ALL_MOTORS = ['BwC', 'BwR', 'BwL', 'BpC', 'BpR', 'BpL']¶
- SPINNING_MOTORS = ['BpC', 'BpR', 'BpL']¶
- TURNING_MOTORS = ['BwC', 'BwR', 'BwL']¶
- __init__(motors_manager: MotorsManager, config: dict, power: BatterySystem = None)¶
Initialize three-wheel swerve drive navigation platform.
- Parameters:
motors_manager (MotorsManager) – Manager for motor communication
config (dict) – Configuration dict with “motors” and “nav_planner” keys
power (BatterySystem, optional) – Battery system instance for power management
- disable_drive_motor_current()¶
- disable_motors(*args, **kwargs)¶
- enable_drive_motor_current()¶
- enable_motors(*args, **kwargs)¶
- get_system_state(*args, **kwargs)¶
- health_check(*args, **kwargs)¶
- is_aborting(*args, **kwargs)¶
- is_motors_enabled(*args, **kwargs)¶
- load_calibration_data(*args, **kwargs)¶
- on_abort(*args, **kwargs)¶
- on_fork()¶
- on_power_event(*args, **kwargs)¶
- recalibrate(*args, **kwargs)¶
- class feathersdk.robot.navigation_platform.VelocityNavigationPlanner(nav_platform, config: dict)¶
Bases:
NavigationPlannerAllows the robot to be controlled by a specified velocity. TODO: The name of this class is misleading. A Planner builds a plan but does not control the robot in pure terms. This should be called VelocityController to better represent its purpose. Leaving for now for backward compatibility.
Developer Notes: Any public methods of this class should follow _validate_and_accept_command() pattern in existing methods to ensure safety and error handling.
- disable_motors(is_power_off: bool = False)¶
Disable motors and clear command state.
- Parameters:
is_power_off (bool) – If True, motors are not disabled (for power-off scenarios)
- enable_motors()¶
Enable all navigation motors and verify they enter Run mode.
- Raises:
UnknownInterfaceError – If communication interface is not available, platform is disabled.
Exception – If enabling motors fails for any reason, platform is disabled.
- go_to(degrees, speed, motors_is_on=False)¶
Set wheel orientation and speed for directional movement.
- Parameters:
degrees (float) – Target wheel angle in degrees from -90 to 90 (0 = forward). All wheels will be turned to this angle.
speed (float) – Target linear speed in m/s, range -1.3 to 1.3 m/s.
motors_is_on (bool) – If False, enables motors before command. If True, assumes motors already enabled.
- Raises:
ValueError – If degrees or speed are outside valid ranges
Exception – If platform not enabled or calibration state is unhealthy
NavigationMotorError – If motor errors occurred in previous step() execution
Note
For target angles of exactly -90 or +90, each turning motor will choose whichever angle is closer to its current position to minimize rotation. The speed sign is adjusted per motor accordingly to maintain the intended direction of travel. This optimization is applied in step() at execution time.
- is_at_target_position()¶
Check if robot is at target position.
For velocity-based control, this always returns True as there is no discrete target position.
- Returns:
Always True for velocity control mode
- Return type:
bool
- orient_angle(degrees)¶
Set wheel orientation without changing speed.
- Parameters:
degrees (float) – Target angle in degrees from -90 to 90 (0 = forward, clockwise positive).
- Raises:
Exception – If platform not enabled or calibration state is unhealthy
NavigationMotorError – If motor errors occurred in previous step() execution
- orient_rotate()¶
Orient wheels to rotation configuration and stop spinning motors.
- Raises:
Exception – If platform not enabled or calibration state is unhealthy
NavigationMotorError – If motor errors occurred in previous step() execution
- rotate_in_place(speed)¶
Rotate the robot in place by setting the speed of the spinning motors.
- Parameters:
speed (float) – The speed in degrees/second at which all the spinning motors will rotate.
- Raises:
Exception – If platform not enabled or calibration state is unhealthy
NavigationMotorError – If motor errors occurred in previous step() execution
- set_motor_shutdown_on_abort(shutdown_on_abort: bool)¶
- set_speed(speed)¶
Set linear speed without changing wheel orientation.
- Parameters:
speed (float) – Linear speed in m/s, range -1.3 to 1.3 m/s.
- Raises:
ValueError – If speed is outside valid range
Exception – If platform not enabled or calibration state is unhealthy
NavigationMotorError – If motor errors occurred in previous step() execution
- step()¶
Execute pending navigation commands and monitor feedback delays.
When feedback delay is detected on any motor, the robot is stopped (zero velocity sent once) and the step loop is paused until delay clears. During pause, feedback is triggered (set_active_reporting(False)) so delay can be re-checked. No exception is raised; commands are not sent until pause ends.