RosClient

class compas_fab.backends.RosClient[source]

Bases: Ros, ClientInterface

Interface to use ROS as backend via the rosbridge.

The connection is managed by roslibpy.

RosClient is a context manager type, so it’s best used in combination with the with statement to ensure resource deallocation.

Parameters:
hoststr

ROS bridge host. Defaults to localhost.

portint

Port of the ROS Bridge. Defaults to 9090.

is_securebool

True to indicate it should use a secure web socket, otherwise False.

planner_type: type

Type the planner backend to use. The backend must be a sub-class of compas_fab.backends.PlannerInterface. Defaults to MoveItPlanner.

Notes

For more examples, check out the ROS examples page.

Examples

>>> with RosClient() as client:
...     print('Connected:', client.is_connected)
Connected: True

Methods

execute_joint_trajectory

Execute a joint trajectory via the MoveIt infrastructure.

follow_configurations

follow_joint_trajectory

Follow the joint trajectory as computed by MoveIt planner.

get_configuration

load_robot

Load an entire robot instance -including model and semantics- directly from ROS.

Inherited Methods

add_attached_collision_mesh

Forwards call to appropriate method in the planner.

add_collision_mesh

Forwards call to appropriate method in the planner.

append_collision_mesh

Forwards call to appropriate method in the planner.

authenticate

Sends an authorization request to the server.

blocking_call_from_thread

Call the given function from a thread, and wait for the result synchronously for as long as the timeout will allow.

call_async_service

Send a service request to ROS once the connection is established.

call_in_thread

Call the given function in a thread.

call_later

Call the given function after a certain period of time has passed.

call_sync_service

Send a blocking service request to ROS once the connection is established, waiting for the result to be return.

close

Disconnect from ROS.

connect

Connect to ROS.

delete_param

Delete parameter from the ROS Parameter Server.

emit

Trigger a named event.

forward_kinematics

Forwards call to appropriate method in the planner.

get_action_servers

Retrieve list of action servers in ROS.

get_message_details

Retrieve details of a message type in ROS.

get_node_details

Retrieve list subscribed topics, publishing topics and services of a specific node name.

get_nodes

Retrieve list of active node names in ROS.

get_param

Get the value of a parameter from the ROS Parameter Server.

get_params

Retrieve list of param names from the ROS Parameter Server.

get_planning_scene

Forwards call to appropriate method in the planner.

get_service_request_callback

Get the callback which, when called, sends the service request.

get_service_request_details

Retrieve details of a ROS Service Request.

get_service_response_details

Retrieve details of a ROS Service Response.

get_service_type

Retrieve the type of a service in ROS.

get_services

Retrieve list of active service names in ROS.

get_services_for_type

Retrieve list of services in ROS matching the specified type.

get_time

Retrieve the current ROS time.

get_topic_type

Retrieve the type of a topic in ROS.

get_topics

Retrieve list of topics in ROS.

get_topics_for_type

Retrieve list of topics in ROS matching the specified type.

inverse_kinematics

Forwards call to appropriate method in the planner.

off

Remove a callback from an arbitrary named event.

on

Add a callback to an arbitrary named event.

on_ready

Add a callback to be executed when the connection is established.

plan_cartesian_motion

Forwards call to appropriate method in the planner.

plan_motion

Forwards call to appropriate method in the planner.

remove_attached_collision_mesh

Forwards call to appropriate method in the planner.

remove_collision_mesh

Forwards call to appropriate method in the planner.

reset_planning_scene

Forwards call to appropriate method in the planner.

run

Kick-starts a non-blocking event loop.

run_event_loop

run_forever

Kick-starts a blocking loop to wait for events.

send_on_ready

Send message to ROS once the connection is established.

set_param

Set the value of a parameter from the ROS Parameter Server.

set_status_level

terminate

Signals the termination of the main event loop.