simulation.src.simulation_groundtruth.src.groundtruth.node module

Summary

Classes:

GroundtruthNode

ROS node providing services to access the road’s groundtruth.

LabeledPolygonService

Small wrapper class to easily create ROS services that offer LabeledPolygonMsgs.

Reference

class LabeledPolygonService(topic: str, callback: Callable[[id], List[simulation_groundtruth.msg._LabeledPolygon.LabeledPolygon]])[source]

Bases: object

Small wrapper class to easily create ROS services that offer LabeledPolygonMsgs.

topic: str
callback: Callable[[id], List[simulation_groundtruth.msg._LabeledPolygon.LabeledPolygon]]
request(request: simulation_groundtruth.srv._LabeledPolygonSrv.LabeledPolygonSrv) → simulation_groundtruth.srv._LabeledPolygonSrv.LabeledPolygonSrvResponse[source]

Answer service request.

shutdown()[source]
class GroundtruthNode(name='groundtruth_node', log_level=2)[source]

Bases: simulation.utils.ros_base.node_base.NodeBase

ROS node providing services to access the road’s groundtruth.

groundtruth

Stores road sections and allows to access groundtruth information.

Type

Groundtruth

renderer

Render and update the road in Gazebo.

Type

Renderer

object_controller

Create and track objects (e.g. obstacles, signs) in Gazebo.

Type

ObjectController

section_srv

ROS service to access section ids and types.

Type

rospy.Service

lane_srv

ROS service to access the lanes of a road section.

Type

rospy.Service

obstacle_srv

ROS service to access obstacles in a road section.

Type

rospy.Service

parking_srv

ROS service to access parking spots and other parking information.

Type

rospy.Service

surface_marking_srv

ROS service to access surface markings in a road section.

Type

rospy.Service

intersection_srv

ROS service to access information of an intersection.

Type

rospy.Service

_load_road()simulation.utils.road.road.Road[source]

Load road sections from current road.

_ensure_gazebo_startup()[source]

Make sure that gazebo is correctly launched.

Waiting for Gazebo is not as easy as it should be. This function, however, is a workaround. It attempts to spawn a model until it is there. Once the model has been spawned, it is directly removed again. At this point, Gazebo has been completely launched.

Beware: The model has no collision box and is not visible. It is therefore not problematic if it is not correctly removed!

start()[source]

Called when activating the node.

stop()[source]

Turn off.

update()[source]

Update the groundtruth including renderer and object controller.

get_sections(request: simulation_groundtruth.srv._SectionSrv.SectionSrvRequest) → simulation_groundtruth.srv._SectionSrv.SectionSrvResponse[source]

Answer section service request.

get_lanes(request: simulation_groundtruth.srv._LaneSrv.LaneSrvRequest) → simulation_groundtruth.srv._LaneSrv.LaneSrvResponse[source]

Answer lane service request.

get_parking(request: simulation_groundtruth.srv._ParkingSrv.ParkingSrvRequest) → simulation_groundtruth.srv._ParkingSrv.ParkingSrvResponse[source]

Answer parking service request.

get_intersection(request: simulation_groundtruth.srv._IntersectionSrv.IntersectionSrvRequest) → simulation_groundtruth.srv._IntersectionSrv.IntersectionSrvResponse[source]

Answer intersection service request.

receive_model_states(model_states: gazebo_msgs.msg._ModelStates.ModelStates)[source]
receive_car_state(car_state: gazebo_simulation.msg._CarState.CarState)[source]
_spawn_model(model_xml: str)[source]

Spawn a model in Gazebo.

Parameters

model_xml – XML String that defines the model. (Without sdf declaration!)

_remove_model(name)[source]

Remove a model from Gazebo.

Parameters

name – Name of the model in Gazebo.

_pause_gazebo()[source]

Pause Gazebo.

_unpause_gazebo()[source]

Request to start Gazebo.

receive_reload_request(_: std_msgs.msg._Empty.Empty)[source]

Receive requests to reload the world.

receive_interrupt_request(_: std_msgs.msg._Empty.Empty)[source]

Receive requests to stop rendering processes.

update_groundtruth_status(status=None, processed_tiles=None, number_of_tiles=None)[source]