# Actors

Actors (`RoarPyActor`) are basic moving units in ROAR\_PY.&#x20;

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

{% hint style="info" %}
All actions are compatible with gymnasium interfaces

See `RoarPyActor.get_action_spec()`
{% endhint %}

Actors can also carry sensors and return observations to you. You can read those observations via `RoarPyActor.get_sensors(...)` then `await RoarPySensor.receive_observation()`.&#x20;

{% hint style="success" %}
Some actors come with their own sensors attached, and some actors might need manual configuration for sensor attachments.&#x20;

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`
{% endhint %}

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()`

{% hint style="info" %}
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()`
{% endhint %}
