hbp_nrp_cle.robotsim.RobotInterface module¶
This module represents the interfaces for the robot (world) simulation both in terms of data exchange and control of the simulation
-
class
IRobotCommunicationAdapter
[source]¶ Bases:
object
Represents the communication adapter to the robot
-
create_service_proxy
(service, **config)[source]¶ Creates a service proxy object for the given service
- Parameters
service – The Service
config – Additional configuration for the service proxy
- Returns
A service proxy object
-
create_topic_publisher
(topic, **config)[source]¶ Creates a publisher object for the given topic
- Parameters
topic – The topic
config – Additional configuration for the publisher
- Returns
A publisher object
-
create_topic_subscriber
(topic, **config)[source]¶ Creates the subscription object for the given topic
- Parameters
topic – The topic
config – Additional configuration for the subscriber
- Returns
A subscription object
-
property
published_topics
¶ Gets the published topics for the robot communication adapter
- Returns
A hash table of the communication adapters published topics
-
refresh_buffers
(t)[source]¶ Refreshes the subscribed topic buffers for the given simulation time
- Parameters
t – The simulation time
-
register_publish_topic
(topic, **kwargs)[source]¶ Requests a publisher object for the given topic
- Parameters
topic – The topic for which to create a publisher
kwargs – Additional configuration parameters
- Returns
A publisher communication object
-
register_service_proxy
(service, **kwargs)[source]¶ Requests a proxy object for the given service
- Parameters
service – The service to which a proxy should be established
kwargs – Additional configuration parameters
- Returns
A responder object that holds the current data
-
register_subscribe_topic
(topic, **kwargs)[source]¶ Requests a subscription object for the given topic
- Parameters
topic – The topic that should be subscribed
kwargs – Additional configuration parameters
- Returns
A subscription object that holds the current data
-
property
service_proxies
¶ Gets the service proxies for the robot communication adapter
- Returns
A hash table of the communication adapters service responses
-
property
subscribed_topics
¶ Gets the subscribed topics for the robot communication adapter
- Returns
A hash table of the communication adapters subscribed topics
-
unregister_publish_topic
(topic)[source]¶ Unregisters and removes the given publisher topic object.
- Parameters
topic – The IRobotPublishedTopic to unregister.
-
-
class
IRobotControlAdapter
[source]¶ Bases:
object
Represents a control adapter for the world simulation
-
property
is_alive
¶ Queries the current status of the world simulation
- Returns
True, if the world simulation is alive, otherwise False
-
property
is_paused
¶ Queries the current status of the physics simulation
- Returns
True, if the physics simulation is paused, otherwise False
-
reset_world
(models, lights)[source]¶ Resets the world excluding the robot
- Parameters
models – A dictionary containing pairs model_name: model_sdf.
lights – A dictionary containing pairs light_name: light sdf.
-
run_step
(dt)[source]¶ Runs the world simulation for the given CLE time step in seconds
- Parameters
dt – The CLE time step in seconds
- Returns
Updated simulation time, otherwise -1
-
run_step_async
(dt)[source]¶ Runs the world simulation for the given CLE time step in seconds in an asynchronous manner.
- Parameters
dt – The CLE time step in seconds
- Returns
a Future for the result or potential exceptions of the execution
-
set_time_step
(time_step)[source]¶ Sets the physics simulation time step in seconds
- Parameters
dt – The physics simulation time step in seconds
- Returns
True, if the physics simulation time step is updated, otherwise False
-
property
time_step
¶ Gets the physics simulation time step in seconds
- Parameters
dt – The physics simulation time step in seconds
- Returns
The physics simulation time step in seconds
-
property
-
class
IRobotPublishedTopic
[source]¶ Bases:
object
Represents a communication object for a published robot topic
-
class
IRobotServiceProxy
[source]¶ Bases:
object
Represents a communication object for a service proxy
-
reset
(transfer_function_manager)[source]¶ Resets the service proxy
- Parameters
transfer_function_manager – The transfer function manager the service proxy belongs to
- Returns
The reset adapter
-
property
value
¶ Gets the current value of the service response
-
-
class
IRobotSubscribedTopic
[source]¶ Bases:
object
Represents a communication object for a subscribed robot topic
-
property
changed
¶ Gets a value indicating whether the value of the subscribed topic has changed since the last time step
-
reset
(transfer_function_manager)[source]¶ Resets the subscribed topic
- Parameters
transfer_function_manager – The transfer function manager the subscriber belongs to
- Returns
The reset adapter
-
property
value
¶ Gets the current value of the subscribed topic
-
property
-
class
PreprocessedTopic
(name, topic_type, pre_processing)[source]¶ Bases:
hbp_nrp_cle.robotsim.RobotInterface.Topic
Represents a topic where pre-processing is applied to
-
property
pre_processor
¶ Gets the pre_processor
-
property