simulation.src.simulation_groundtruth.src.groundtruth package
Subpackages
Submodules
simulation.src.simulation_groundtruth.src.groundtruth.groundtruth module
Functions:
|
Create a lane message from three lines. |
Classes:
|
Container for information about an intersection. |
|
Provide functionality to extract groundtruth information as ROS messages. |
- _lane_msg_from_lines(left: Line, middle: Line, right: Line) Lane[source]
Create a lane message from three lines.
- class IntersectionTuple(turn, rule, south, west, east, north)
Bases:
tupleContainer for information about an intersection.
Methods:
_asdict()Return a new dict which maps field names to their values.
_make(iterable)Make a new IntersectionTuple object from a sequence or iterable
_replace(**kwds)Return a new IntersectionTuple object replacing specified fields with new values
Attributes:
Lane markings on the right side when coming from south.
Lane markings straight ahead when coming from south.
Priority rule.
Lane markings approaching the intersection.
Direction the road follows.
Lane markings on the left side when coming from south.
- _asdict()
Return a new dict which maps field names to their values.
- _field_defaults = {}
- _fields = ('turn', 'rule', 'south', 'west', 'east', 'north')
- _fields_defaults = {}
- classmethod _make(iterable)
Make a new IntersectionTuple object from a sequence or iterable
- _replace(**kwds)
Return a new IntersectionTuple object replacing specified fields with new values
- east
Lane markings on the right side when coming from south.
- Type:
LaneMsg
- north
Lane markings straight ahead when coming from south.
- Type:
LaneMsg
- rule
Priority rule.
- Type:
int
- south
Lane markings approaching the intersection.
- Type:
LaneMsg
- turn
Direction the road follows.
- Type:
int
- west
Lane markings on the left side when coming from south.
- Type:
LaneMsg
- class Groundtruth(road: Road)[source]
Bases:
objectProvide functionality to extract groundtruth information as ROS messages.
Attributes:
Store the current road.
Methods:
Section message for all sections.
get_lane_msg(id)Lane message for requested road section.
Intersection tuple for requested road section.
get_parking_msg(id)Parking message for the left and right side of the requested road section.
Labeled polygon msg for each surface marking in the requested road section.
Labeled polygon msg for each traffic sign in the requested road section.
- get_lane_msg(id: int) Lane[source]
Lane message for requested road section.
- Parameters:
id – section id
- get_intersection_msg(id: int) IntersectionTuple[source]
Intersection tuple for requested road section.
- Parameters:
id – section id
- get_parking_msg(id: int) Tuple[Parking, Parking][source]
Parking message for the left and right side of the requested road section.
- Parameters:
id – section id
simulation.src.simulation_groundtruth.src.groundtruth.labeled_polygon_service module
Classes:
|
Small wrapper class to easily create ROS services that offer LabeledPolygonMsgs. |
- class LabeledPolygonService(topic: str, callback: Callable[[id], List[LabeledPolygon]])[source]
Bases:
objectSmall wrapper class to easily create ROS services that offer LabeledPolygonMsgs.
Attributes:
Methods:
request(request)Answer service request.
shutdown()- topic: str
- callback: Callable[[id], List[LabeledPolygon]]
simulation.src.simulation_groundtruth.src.groundtruth.node module
Classes:
|
ROS node providing services to access the road's groundtruth. |
- class GroundtruthNode(name='groundtruth_node', log_level=2)[source]
Bases:
NodeBaseROS node providing services to access the road’s groundtruth.
- groundtruth
Stores road sections and allows to access groundtruth information.
- Type:
- 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
- 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
Methods:
Load road sections from current road.
Make sure that gazebo is correctly launched.
start()Called when activating the node.
stop()Turn off.
load()Load the groundtruth including renderer and object controller.
get_sections(request)Answer section service request.
get_lanes(request)Answer lane service request.
get_parking(request)Answer parking service request.
get_intersection(request)Answer intersection service request.
receive_model_states(model_states)_spawn_model(model_xml)Spawn a model in Gazebo.
_remove_model(name)Remove a model from Gazebo.
Pause Gazebo.
Request to start Gazebo.
Receive requests to reload the world.
Receive requests to stop rendering processes.
update_groundtruth_status([status, ...])- _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!
- get_sections(request: SectionSrvRequest) SectionSrvResponse[source]
Answer section service request.
- get_intersection(request: IntersectionSrvRequest) IntersectionSrvResponse[source]
Answer intersection service request.
- _spawn_model(model_xml: str)[source]
Spawn a model in Gazebo.
- Parameters:
model_xml – XML String that defines the model. (Without sdf declaration!)
simulation.src.simulation_groundtruth.src.groundtruth.object_controller_node module
Classes:
|
ROS node to place obstacles and other objects (e.g. |
- class ObjectControllerNode(*, name='object_controller_node', log_level=2)[source]
Bases:
NodeBaseROS node to place obstacles and other objects (e.g. traffic signs) in Gazebo.
Attributes:
Methods:
receive_model_states(model_states)receive_car_state(car_state)receive_status(status_msg)Receive requests to reload the world.
receive_mission_mode(mission_mode)Load road sections from current road.
load()Reload all objects.
start()Called when activating the node.
stop()Called when deactivating or shutting down the node.
_set_model_pose(name, pose)_spawn_model(model_xml)Spawn a model in Gazebo.
_remove_model(name)Remove a model from Gazebo.
_load_and_name(*, objects, prefix)_remove_old_objects(model_names)update()Update the object controller.
Labeled polygon msg for each obstacle in the requested road section.
- active: bool = False
- car_state: CarState = pose: position: x: 0.0 y: 0.0 z: 0.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 0.0 twist: linear: x: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0 frame: points: [] view_cone: points: []
- set_model_pose_publishers: Dict = {}
- obstacle_prefix: str = 'obstacle'
- sign_prefix: str = 'sign'
- start_gate: float | None = None
- model_names = None
- _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.
- property obstacles: List[Tuple[str, StaticObstacle]]
- property dynamic_obstacles: List[Tuple[str, DynamicObstacle]]
- property signs: List[Tuple[str, TrafficSign]]
simulation.src.simulation_groundtruth.src.groundtruth.renderer module
Functions:
Classes:
|
|
|
- class PreviousRendering(seed: str, tile_size: Tuple[float, float], tile_resolution: Tuple[float, float], tiles: Dict[str, str] = <factory>, time: float = <factory>, pretty_time: str = <factory>)[source]
Bases:
objectAttributes:
Methods:
load(dir)Load information about previous rendering from file.
save(dir)Store information about the current rendering.
delete(dir)Delete directory containing all materials of previous renderings.
- DEFAULT_FILE_NAME = 'previous_rendering.yaml'
- seed: str
- tile_size: Tuple[float, float]
- tile_resolution: Tuple[float, float]
- tiles: Dict[str, str]
- time: float
- pretty_time: str
- classmethod load(dir: str) PreviousRendering[source]
Load information about previous rendering from file.
- Parameters:
dir – Path to directory that contains previous rendering.
- class Renderer(road: simulation.utils.road.road.Road, remove_model: Callable[[str], NoneType], spawn_model: Callable[[str], NoneType], pause_gazebo: Callable[[], NoneType], unpause_gazebo: Callable[[], NoneType], info_callback: Callable[[int, int, int], NoneType], tile_size: kitcar_utils.geometry.vector.Vector = Vector(2.0, 2.0, 0.0), tile_resolution: kitcar_utils.geometry.vector.Vector = Vector(512.0, 512.0, 0.0), force_reload: bool = False)[source]
Bases:
objectAttributes:
Function that is called, when the renderer's state changes.
Methods:
save_state(tiles)_remove_displayed_tiles(model_names)load(model_names)- remove_model: Callable[[str], None]
- spawn_model: Callable[[str], None]
- pause_gazebo: Callable[[], None]
- unpause_gazebo: Callable[[], None]
- info_callback: Callable[[int, int, int], None]
Function that is called, when the renderer’s state changes.
- tile_size: Vector = Vector(2.0, 2.0, 0.0)
- tile_resolution: Vector = Vector(512.0, 512.0, 0.0)
- force_reload: bool = False
- property roads_path: str
- property materials_path: str
- property prev_rendering: PreviousRendering
simulation.src.simulation_groundtruth.src.groundtruth.visualization module
Node that publishes groundtruth information for rviz.
Classes:
ROS node to visualize groundtruth objects in RVIZ. |
- class GroundtruthVisualizationNode[source]
Bases:
NodeBaseROS node to visualize groundtruth objects in RVIZ.
- publishers
Automatically generated dictionary containing all publishers. A publisher is created for every visualization topic listed in the parameter file.
- Type:
Dict[rospy.Publisher]
- get_sections, get_lane, get_parking, get_obstacles, get_intersection
Can be called for groundtruth information.
- Type:
rospy.ServiceProxy
Methods:
start()Start the node by creating publishers and service proxies.
stop()Stop the node by unregistering publishers.
_publish_point_marker(points, ...[, ns])Publish an RVIZ marker on the publisher's topic.
_update_labeled_polygon_topic(proxy, ...)Publish polygons for all elements.
Publish markers for all lane markings of road.
Publish markers for all parking lines and spots of road.
Publish lanes and surface markings of all intersections.
update()Update all markers.
- _publish_point_marker(points: List[Point32], publisher_name: str, id: int, rgba: List[float], ns='simulation/groundtruth')[source]
Publish an RVIZ marker on the publisher’s topic.
- Parameters:
points – Points to be published.
publisher_name – Key of the publisher in the publisher dictionary.
id – RVIZ marker id.
rgba – List of the marker color.
ns – RVIZ namespace of the marker.