> ## 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.

# Base Client

## ROSClient

Inherits from: `ABC`

Base class for ROS clients that handles communication with ROS topics.

<ResponseField name="Attributes">
  <ParamField query="msg_type" type="">
    ROS message type for the topic
  </ParamField>

  <ParamField query="latest_msg" type="">
    Most recent message received
  </ParamField>

  <ParamField query="client" type="">
    ROS client instance
  </ParamField>

  <ParamField query="agent" type="">
    Associated agent instance
  </ParamField>
</ResponseField>

### ROSClient

```python
ROSClient(host, port, client_dict, agent_dict)
```

Initialize the ROS client.

<ResponseField name="Arguments">
  <ParamField query="host (str), optional" type="">
    defaults to 'localhost'.
    Hostname of ROS bridge. Defaults to 'localhost'.
  </ParamField>

  <ParamField query="port (int), optional" type="">
    defaults to 8080.
    Port number. Defaults to 8080.
  </ParamField>

  <ParamField query="client_dict (dict), optional" type="">
    defaults to None.
    Dictionary of client configuration parameters. Defaults to None.
  </ParamField>

  <ParamField query="agent_dict (dict), optional" type="">
    defaults to None.
    Dictionary containing agent instance. Defaults to None.
  </ParamField>
</ResponseField>

### getLatestMessage

```python
ROSClient.getLatestMessage()
```

Helper method to get the latest message.

<ResponseField name="Returns">
  The most recent message received from the ROS topic.
</ResponseField>

### process\_latest\_msg

```python
ROSClient.process_latest_msg()
```

### msg\_cb

```python
ROSClient.msg_cb(msg)
```

### run

```python
ROSClient.run()
```

### get\_messages

```python
ROSClient.get_messages()
```

Get all messages from the client.

<ResponseField name="Returns">
  List of messages received by the client.
</ResponseField>

### stop

```python
ROSClient.stop()
```
