🚘Actors
Actors (RoarPyActor
) are basic moving units in ROAR_PY.
You can issue action commands to them through await RoarPyActor.apply_action(...)
and they will perform it. The action commands should differ with different underlying hardwares. An example action command is the vehicle action command, which consists of a python dict
class with several string keys and np.ndarray
values
All actions are compatible with gymnasium interfaces
See RoarPyActor.get_action_spec()
Actors can also carry sensors and return observations to you. You can read those observations via RoarPyActor.get_sensors(...)
then await RoarPySensor.receive_observation()
.
Some actors come with their own sensors attached, and some actors might need manual configuration for sensor attachments.
For example, a robot dog from Boston Dynamics may already have some imu / camera sensors attached and ready to read from, but a vehicle in carla requires you to specify what kind of sensors you want to attach to it.
If an actor can attach extra sensors, it will expose methods to you. For example, a RoarPyCarlaActor
exposes you with methods such as attach_camera_sensor
Or if you want to read data returned by all sensors attached to the actor, simply use await RoarPyActor.receive_observation()
.
If you don't want to read new data and just want to read old data, use RoarPyActor.get_last_observation()
All observations are compatible with gymnasium interfaces through conversion
See RoarPyActor.get_gym_observation_spec()
, RoarPyActor.get_last_gym_observation()
Note that get_last_gym_observation()
is only available after calling receive_observation()
Last updated