hbp_nrp_cleserver.server.SimulationServer module

Playback ROS wrapper overriding the ROSCLEServer implementation for playback

class SimulationServer(sim_id, timeout, timeout_type, gzserver, notificator)[source]

Bases: object

Playback ROS server overriding the ROSCLEServer implementation for playback

STATUS_UPDATE_INTERVAL = 1.0
get_remaining()[source]

Get the remaining time of the simulation and stop it when time runs out

property lifecycle

Gets the lifecycle instance representing the current ROSCLEServer

prepare_simulation(except_hook=None)[source]

The CLE will be initialized within this method and ROS services for starting, pausing, stopping and resetting are setup here.

Parameters

except_hook – A handler method for critical exceptions

publish_state_update()[source]

Publish the playback state and the remaining timeout

reset_simulation(request)[source]

Reset the playback

Parameters

request – the ROS service request message (cle_ros_msgs.srv.ResetSimulation).

run()[source]

This method blocks the caller until the simulation is finished

shutdown()[source]

Shutdown the playback

property simulation_id

Gets the simulation id that is serviced

property simulation_time

Gets the simulation time

class TimeoutType[source]

Bases: object

The type of the simulation timeout. Simulation time can be REAL or SIMULATION, relying respectively on the elapsed time or the simulation time

REAL = 'real'
SIMULATION = 'simulation'