kompass.components.drive_manager#

Module Contents#

Classes#

DriveManagerConfig

Drive manager node config

DriveManager

DriveManager.

API#

class kompass.components.drive_manager.DriveManagerConfig#

Bases: kompass.config.ComponentConfig

Drive manager node config

class kompass.components.drive_manager.DriveManager(component_name: str, config_file: Optional[str] = None, config: Optional[kompass.components.drive_manager.DriveManagerConfig] = None, inputs=None, outputs=None, **kwargs)#

Bases: kompass.components.component.Component

DriveManager.

property run_type: kompass.config.ComponentRunType#

Component run type: Timed, ActionServer or Event

Returns:

Timed, ActionServer or Server

Return type:

str

init_flags()#

Setup node flags to track operations flow

init_variables()#

Overwrites the init variables method called at Node init

attach_callbacks()#

Attaches emergency_stop_check to sensor_data callback anf filtering commands to commands callbacks

move_forward(max_distance: float) bool#

Moves the robot forward if the forward direction is clear of obstacles

Parameters:

max_distance (float) – Maximum distance (m)

Returns:

If the movement action is performed

Return type:

bool

move_backward(max_distance: float) bool#

Moves the robot backwards if the backward direction is clear of obstacles

Parameters:

max_distance (float) – Maximum distance (m)

Returns:

If the movement action is performed

Return type:

bool

rotate_in_place(max_rotation: float, safety_margin: Optional[float] = None) bool#

Rotates the robot in place if a safety margin around the robot is clear

Parameters:

safety_margin (Optional[float], optional) – Margin clear of obstacles to perform rotation, if None defaults to 5% of the robot_radius

Returns:

If the movement action is performed

Return type:

bool

move_to_unblock(max_distance_forward: Optional[float] = None, max_distance_backwards: Optional[float] = None, max_rotation: float = np.pi / 4, rotation_safety_margin: Optional[float] = None) bool#

Moves the robot forward/backward or rotate in place to get out of blocking spots

Parameters:
  • max_distance_forward (Optional[float], optional) – Maximum distance to move forward (meters), if None defaults to 2 * robot_radius

  • max_distance_backwards (Optional[float], optional) – Maximum distance to move backwards (meters), if None defaults to 2 * robot_radius

  • max_rotation (float, optional) – Maximum rotation angle (radians), defaults to np.pi/4

  • rotation_safety_margin (Optional[float], optional) – Safety margin to perform rotation in place (meters), if None defaults to 5% of robot_radius

Returns:

If one of the movement actions is performed

Return type:

bool

check_limits()#

Check and limit the control commands

Parameters:

cmd (Twist) – Robot control command

Returns:

Limited control command

Return type:

Twist