ROSClient

Inherits from: ABC

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

Attributes
msg_type

ROS message type for the topic

latest_msg

Most recent message received

client

ROS client instance

agent

Associated agent instance

ROSClient

ROSClient(host, port, client_dict, agent_dict)

Initialize the ROS client.

Arguments
host (str), optional

defaults to ‘localhost’. Hostname of ROS bridge. Defaults to ‘localhost’.

port (int), optional

defaults to 8080. Port number. Defaults to 8080.

client_dict (dict), optional

defaults to None. Dictionary of client configuration parameters. Defaults to None.

agent_dict (dict), optional

defaults to None. Dictionary containing agent instance. Defaults to None.

getLatestMessage

ROSClient.getLatestMessage()

Helper method to get the latest message.

Returns

The most recent message received from the ROS topic.

process_latest_msg

ROSClient.process_latest_msg()

msg_cb

ROSClient.msg_cb(msg)

run

ROSClient.run()

get_messages

ROSClient.get_messages()

Get all messages from the client.

Returns

List of messages received by the client.

stop

ROSClient.stop()

Was this page helpful?