> ## Documentation Index
> Fetch the complete documentation index at: https://scaledfoundations-rebrand.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent

## RosAgent

Inherits from: [Robot](/robot-api/grid/robot/robot#robot)

A class to represent a ROS-based robot agent.

This class inherits from Robot and implements ROS-specific functionality for
communicating with and controlling a robot through ROS topics.

### RosAgent

```python
RosAgent(client_config: dict, agent_dict: dict | None)
```

Initialize a ROS agent with the given client configuration.

<ResponseField name="Arguments">
  <ParamField query="client_config (dict)" type="" required>
    Configuration dictionary specifying ROS clients and their parameters
  </ParamField>

  <ParamField query="agent_dict (dict | None), optional" type="">
    defaults to None.
    Optional dictionary of agent-specific parameters. Defaults to None.
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### create\_clients

```python
RosAgent.create_clients(client_config: dict, agent_config: dict | None)
```

Create ROS clients based on configuration.

<ResponseField name="Arguments">
  <ParamField query="client_config (dict)" type="" required>
    Dictionary of client configurations
  </ParamField>

  <ParamField query="agent_config (dict | None)" type="" required>
    Optional dictionary of agent parameters
  </ParamField>
</ResponseField>

### getImage

```python
RosAgent.getImage(name: str, image_type: str)
```

Get image from named image client.

<ResponseField name="Arguments">
  <ParamField query="name (str), optional" type="">
    Name of image client
  </ParamField>

  <ParamField query="image_type (str), optional" type="">
    Unused
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  [Image](/robot-api/grid/utils/types#image)

  Image object
</ResponseField>

### getPosition

```python
RosAgent.getPosition(name: str)
```

Get position from named pose client.

<ResponseField name="Arguments">
  <ParamField query="name (str), optional" type="">
    Name of pose client
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  Position | list: Position object or raw position data
</ResponseField>

### getOrientation

```python
RosAgent.getOrientation(name: str)
```

Get orientation from named pose client.

<ResponseField name="Arguments">
  <ParamField query="name (str), optional" type="">
    Name of pose client
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  [Orientation](/robot-api/grid/utils/types#orientation)

  Orientation of agent as a quaternion
</ResponseField>

### sendVelocity

```python
RosAgent.sendVelocity(linear_vel: Velocity, angular_vel: Velocity, name: str)
```

Send velocity command to named velocity client.

<ResponseField name="Arguments">
  <ParamField query="linear_vel (Velocity)" type="" required>
    [Velocity](/robot-api/grid/utils/types#velocity)

    Linear velocity components
  </ParamField>

  <ParamField query="angular_vel (Velocity)" type="" required>
    [Velocity](/robot-api/grid/utils/types#velocity)

    Angular velocity components
  </ParamField>

  <ParamField query="name (str), optional" type="">
    Name of velocity client
  </ParamField>
</ResponseField>

### sendPose

```python
RosAgent.sendPose(position: Position, orientation: Orientation | None, name: str)
```

Send pose command to named pose client.

<ResponseField name="Arguments">
  <ParamField query="position (Position)" type="" required>
    [Position](/robot-api/grid/utils/types#position)

    Target position
  </ParamField>

  <ParamField query="orientation (Orientation | None)" type="" required>
    Target orientation (defaults to \[0,0,0,1] if None)
  </ParamField>

  <ParamField query="name (str), optional" type="">
    Name of pose client
  </ParamField>
</ResponseField>

### publishMsg

```python
RosAgent.publishMsg(msg: dict, name: str)
```

Publish a message to a named generic client.

<ResponseField name="Arguments">
  <ParamField query="msg (dict)" type="" required>
    Message to publish
  </ParamField>

  <ParamField query="name (str), optional" type="">
    Name of the generic client
  </ParamField>
</ResponseField>

### getMsg

```python
RosAgent.getMsg(name: str)
```

Get a message from a named generic client.

<ResponseField name="Arguments">
  <ParamField query="name (str), optional" type="">
    Name of the generic client
  </ParamField>
</ResponseField>

### run

```python
RosAgent.run()
```

### stop

```python
RosAgent.stop()
```
