hbp_nrp_cle.robotsim.RobotManager module

This module manages robot resources in CLE for a running simulation. Addition, deletion, update, and en/disabling of robots should be handled in this module.

CLE Assembly (cleserver) creates an object of this class, and passes around.

class Robot(rid, sdf_abs_path, display_name, pose, is_custom=False, roslaunch_abs_path=None, model=None)[source]

Bases: object

Robot model structure to be used in the CLE

class RobotManager[source]

Bases: object

Manages robot resources in the CLE

add_robot(robot)[source]

Add a robot object

Parameters

robot – A cle.robotsim.Robot object

delete_robot_from_scene(robot_id)[source]

Deletes a robot from the 3D scene

Parameters

robot_id – Id of the robot to be deleted. Ignores the call if id is missing

get_robot(robot_id)[source]

Get Robot instance of the robot of the given id

Parameters

robot_id – id of the robot

Returns

A cle.robotsim.Robot object

get_robot_dict()[source]

Gets a reference to the robot dictionary with robot id as key and Robot object as value

Returns

robot list

get_robot_dict_clone()[source]
Returns

A copy of the robot dictionary with robot id as key and Robot object as value

init_scene_handler()[source]

Returns a reference to the active scene handler for the physics simulator. Can only be called after gazebo is started.

Returns

a reference to the active scene handler for the physics simulator

initialize(robot)[source]

Initialize a robot into the scene

Parameters

robot – robot to be initialize

remove_all_robots()[source]

Remove all robots from the manager

remove_robot(robot_id)[source]

Remove robot of the given Id

Parameters

robot_id – id of the robot to be removed

property retina_config

Gets retina config

scene_handler()[source]

Helper function to ensure scene handler is not being accessed before initializing gazebo

Returns

A scene handler object capable of manipulating the 3D scene, e.g., gazebo scene

Raises

Exception – is raised if accessed before initializing the physics engine

set_robot_dict(new_dict)[source]

Set the robot dictionary

Returns

robot list

shutdown()[source]

Cleans up any process or resource used by the manager