sergi/api index bug (#2363)
* PythonAPI reuploaded * Second draft with some fixes * New third iteration full Python API * Fourth iteration on PythonAPI * Bounding box and Vehiclecontrol fixes * Index fixed, added map suggestions. * Added a note regarding when a vehicle is considered to be at traffic light.
This commit is contained in:
parent
731451d43e
commit
06b5a3d97b
1355
Docs/python_api.md
1355
Docs/python_api.md
File diff suppressed because it is too large
Load Diff
|
@ -5,136 +5,94 @@
|
|||
- class_name: Actor
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Base class for all actors.
|
||||
|
||||
Actor is anything that plays a role in the simulation and can be moved
|
||||
around, examples of actors are vehicles, pedestrians, and sensors.
|
||||
CARLA defines actors as anything that plays a role in the simulation or can be moved around. That includes: pedestrians, vehicles, sensors and traffic signs (considering traffic lights as part of these). Actors are spawned in the simulation by carla.World and they need for a carla.ActorBlueprint to be created. These blueprints belong into a library provided by CARLA, find more about them [here](../bp_library/).
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: id
|
||||
type: int
|
||||
doc: >
|
||||
Unique id identifying this actor. Note ids are unique during a
|
||||
given episode.
|
||||
- var_name: type_id
|
||||
type: str
|
||||
doc: >
|
||||
Id of the blueprint that created this actor, e.g.
|
||||
"vehicle.ford.mustang".
|
||||
- var_name: parent
|
||||
type: carla.Actor
|
||||
doc: >
|
||||
Parent actor of this instance, None if this instance is not attached to
|
||||
another actor.
|
||||
- var_name: semantic_tags
|
||||
type: list(int)
|
||||
doc: >
|
||||
List of semantic tags of all components of this actor, see semantic
|
||||
segmentation sensor for the list of available tags. E.g., a traffic
|
||||
light actor could contain "pole" and "traffic light" tags.
|
||||
- var_name: is_alive
|
||||
type: bool
|
||||
deprecated: >
|
||||
This method is not reliable to check if an actor is still alive. Use
|
||||
`world.get_actor(actor.id)` to check if the actor is still present in
|
||||
the simulation.
|
||||
doc: >
|
||||
Returns whether this object was destroyed using this actor handle.
|
||||
- var_name: attributes
|
||||
type: dict
|
||||
doc: >
|
||||
Dictionary of attributes of the blueprint that created this actor.
|
||||
A dictionary containing the attributes of the blueprint this actor was based on.
|
||||
- var_name: id
|
||||
type: int
|
||||
doc: >
|
||||
Identifier for this actor. Unique during a given episode.
|
||||
- var_name: parent
|
||||
type: carla.Actor
|
||||
doc: >
|
||||
Actors may be attached to a parent actor that they will follow around. This is said actor.
|
||||
- var_name: semantic_tags
|
||||
type: list(int)
|
||||
doc: >
|
||||
A list of semantic tags provided by the blueprint listing components for this actor. E.g. a traffic light could be tagged with "pole" and "traffic light". These tags are used by the semantic segmentation sensor. Find more about this and other sensors [here](../cameras_and_sensors/#sensor.camera.semantic_segmentation).
|
||||
- var_name: type_id
|
||||
type: str
|
||||
doc: >
|
||||
The identifier of the blueprint this actor was based on, e.g. "vehicle.ford.mustang".
|
||||
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: destroy
|
||||
return: bool
|
||||
- def_name: __str__
|
||||
return: str
|
||||
doc: >
|
||||
Tell the simulator to destroy this Actor, and return whether the actor
|
||||
was successfully destroyed. It has no effect if the Actor was already
|
||||
successfully destroyed.
|
||||
warning: >
|
||||
This function blocks until the destruction operation is completed by the
|
||||
simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_world
|
||||
return: carla.World
|
||||
doc: >
|
||||
Returns the world this actor belongs to.
|
||||
# --------------------------------------
|
||||
- def_name: get_location
|
||||
return: carla.Location
|
||||
doc: >
|
||||
Returns the actor's current location.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the location
|
||||
received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_transform
|
||||
return: carla.Transform
|
||||
doc: >
|
||||
Returns the actor's current transform.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the
|
||||
transform received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_velocity
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Returns the actor's current 3D velocity.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the velocity
|
||||
received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_angular_velocity
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Returns the actor's current 3D angular velocity.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the angular
|
||||
velocity received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_acceleration
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Returns the actor's current 3D acceleration.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the acceleration
|
||||
received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: set_location
|
||||
params:
|
||||
- param_name: location
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Teleport the actor to a given location.
|
||||
# --------------------------------------
|
||||
- def_name: set_transform
|
||||
params:
|
||||
- param_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
Teleport the actor to a given transform.
|
||||
# --------------------------------------
|
||||
- def_name: set_velocity
|
||||
params:
|
||||
- param_name: velocity
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Set the actor's velocity.
|
||||
# --------------------------------------
|
||||
- def_name: set_angular_velocity
|
||||
params:
|
||||
- param_name: angular_velocity
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Set the actor's angular velocity.
|
||||
Parses a summary of this actor's information to string.
|
||||
# --------------------------------------
|
||||
- def_name: add_impulse
|
||||
params:
|
||||
- param_name: impulse
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Add impulse to the actor.
|
||||
Adds an impulse to the actor.
|
||||
# --------------------------------------
|
||||
- def_name: destroy
|
||||
return: bool
|
||||
doc: >
|
||||
Tells the simulator to destroy this actor and returns <b>True</b> if it was successful. It has no effect if it was already destroyed.
|
||||
warning: >
|
||||
This method blocks the script until the destruction is completed by the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_acceleration
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Returns the actor's 3D acceleration vector the client recieved during last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_angular_velocity
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Returns the actor's angular velocity vector the client recieved during last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_location
|
||||
return: carla.Location
|
||||
doc: >
|
||||
Returns the actor's location the client recieved during last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_transform
|
||||
return: carla.Transform
|
||||
doc: >
|
||||
Returns the actor's transform (location and rotation) the client recieved during last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_velocity
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Returns the actor's velocity vector the client recieved during last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_world
|
||||
return: carla.World
|
||||
doc: >
|
||||
Returns the world this actor belongs to.
|
||||
# --------------------------------------
|
||||
- def_name: set_angular_velocity
|
||||
params:
|
||||
- param_name: angular_velocity
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Changes the actor's angular velocity vector.
|
||||
# --------------------------------------
|
||||
- def_name: set_location
|
||||
params:
|
||||
- param_name: location
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Teleports the actor to a given location.
|
||||
# --------------------------------------
|
||||
- def_name: set_simulate_physics
|
||||
params:
|
||||
|
@ -142,10 +100,21 @@
|
|||
type: bool
|
||||
default: True
|
||||
doc: >
|
||||
Enable or disable physics simulation on this actor.
|
||||
Enables or disables the simulation of physics on this actor.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
- def_name: set_transform
|
||||
params:
|
||||
- param_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
Teleports the actor to a given transform (location and rotation).
|
||||
# --------------------------------------
|
||||
- def_name: set_velocity
|
||||
params:
|
||||
- param_name: velocity
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Sets the actor's velocity vector.
|
||||
# --------------------------------------
|
||||
- class_name: VehicleLightState
|
||||
# - DESCRIPTION ------------------------
|
||||
|
@ -183,13 +152,13 @@
|
|||
parent: carla.Actor
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
A vehicle actor.
|
||||
One of the most important group of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bycicles and also official vehicles such as police cars. A wide set of these actors is provided in carla.BlueprintLibrary to facilitate differente requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the <b>traffic manager</b>.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: bounding_box
|
||||
type: carla.BoundingBox
|
||||
doc: >
|
||||
The vehicle's bounding box
|
||||
The vehicle's collider volume.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: get_light_state
|
||||
|
@ -213,71 +182,54 @@
|
|||
- param_name: control
|
||||
type: carla.VehicleControl
|
||||
doc: >
|
||||
Apply control to this vehicle. The control will take effect on next
|
||||
tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_control
|
||||
return: carla.VehicleControl
|
||||
doc: >
|
||||
Returns the control last applied to this vehicle.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data received
|
||||
in the last tick.
|
||||
Applies a control object on the next tick, containing driving parameters such as throttle, steering or gear shifting.
|
||||
# --------------------------------------
|
||||
- def_name: apply_physics_control
|
||||
params:
|
||||
- param_name: physics_control
|
||||
type: carla.VehiclePhysicsControl
|
||||
doc: >
|
||||
Apply physics control to this vehicle. The control will take effect on the
|
||||
next tick.
|
||||
Applies a physics control object in the next tick containing the parameters that define the vehicle as a corporeal body. E.g.: moment of inertia, mass, drag coefficient and many more.
|
||||
# --------------------------------------
|
||||
- def_name: get_control
|
||||
return: carla.VehicleControl
|
||||
doc: >
|
||||
The client returns the control applied in the last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_physics_control
|
||||
return: carla.VehiclePhysicsControl
|
||||
doc: >
|
||||
Returns the physics control last applied to this vehicle.
|
||||
The simulator returns the last physics control applied to this vehicle.
|
||||
warning: This function does call the simulator to retrieve the value.
|
||||
# --------------------------------------
|
||||
- def_name: get_speed_limit
|
||||
return: float
|
||||
doc: >
|
||||
The client returns the speed limit affecting this vehicle according to last tick (it does not call the simulator). The speed limit is updated when passing by a speed limit signal, so a vehicle might have none right after spawning.
|
||||
# --------------------------------------
|
||||
- def_name: get_traffic_light
|
||||
return: carla.TrafficLight
|
||||
doc: >
|
||||
Retrieves the traffic light actor affecting this vehicle (if any) according to last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_traffic_light_state
|
||||
return: carla.TrafficLightState
|
||||
doc: >
|
||||
The client returns the state of the traffic light affecting this vehicle according to last tick. The method does not call the simulator.
|
||||
If no traffic light is currently affecting the vehicle, returns <b>green</b>.
|
||||
# --------------------------------------
|
||||
- def_name: is_at_traffic_light
|
||||
return: bool
|
||||
doc: >
|
||||
Vehicles will be affected by a traffic light when the light is red and the vehicle is inside its bounding box. The client returns whether a traffic light is affecting this vehicle according to last tick (it does not call the simulator).
|
||||
# --------------------------------------
|
||||
- def_name: set_autopilot
|
||||
params:
|
||||
- param_name: enabled
|
||||
type: bool
|
||||
default: True
|
||||
doc: >
|
||||
Switch on/off this vehicle's server-side autopilot.
|
||||
# --------------------------------------
|
||||
- def_name: get_speed_limit
|
||||
return: float
|
||||
doc: >
|
||||
Returns the speed limit currently affecting this vehicle. Note that the
|
||||
speed limit is only updated when passing by a speed limit signal, right
|
||||
after spawning a vehicle it might not reflect the actual speed limit of
|
||||
the current road.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data received
|
||||
in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_traffic_light_state
|
||||
return: carla.TrafficLightState
|
||||
doc: >
|
||||
Returns the state of the traffic light currently affecting this vehicle.
|
||||
If no traffic light is currently affecting the vehicle, return Green.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data received
|
||||
in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: is_at_traffic_light
|
||||
return: bool
|
||||
doc: >
|
||||
Returns whether a traffic light is affecting this vehicle.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data received
|
||||
in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_traffic_light
|
||||
return: carla.TrafficLight
|
||||
doc: >
|
||||
Retrieve the traffic light actor currently affecting this vehicle.
|
||||
Turns on/off this vehicle's server-side autopilot. When autopilot mode is on, the vehicle will be conducted by the traffic manager client-side.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
|
@ -287,13 +239,13 @@
|
|||
parent: carla.Actor
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
A walking actor, pedestrian.
|
||||
This class inherits from the carla.Actor and defines pedestrians in the simulation. Walkers are a special type of actor that can be controlled either by an AI (carla.WalkerAIController) or manually via script, using a series of carla.WalkerControl to move these and their skeletons.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: bounding_box
|
||||
type: carla.BoundingBox
|
||||
doc: >
|
||||
The walker's bounding box.
|
||||
The walker's collider defined by a bounding box.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: apply_control
|
||||
|
@ -301,26 +253,19 @@
|
|||
- param_name: control
|
||||
type: carla.WalkerControl
|
||||
doc: >
|
||||
Apply control to this walker.
|
||||
note: >
|
||||
The control will take effect on the next tick.
|
||||
On the next tick, the control will move the walker in a certain direction with a certain speed. Jumps can be commanded too.
|
||||
# --------------------------------------
|
||||
- def_name: apply_control
|
||||
params:
|
||||
- param_name: control
|
||||
type: carla.WalkerBoneControl
|
||||
doc: >
|
||||
Apply bone control to this walker.
|
||||
note: >
|
||||
The control will take effect on the next tick.
|
||||
On the next tick, the control defines a list of bone transformations that will be applied to the walker's skeleton.
|
||||
# --------------------------------------
|
||||
- def_name: get_control
|
||||
return: carla.WalkerControl
|
||||
doc: >
|
||||
Returns the control last applied to this walker.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data received
|
||||
in the last tick.
|
||||
The client returns the control applied to this walker during last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
|
@ -330,16 +275,16 @@
|
|||
parent: carla.Actor
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class used for controlling the automation of a pedestrian.
|
||||
Class that conducts AI control for a walker. The controllers are defined as actors, but they are quite different from the rest. They need to be attached to a parent actor during their creation, which is the walker they will be controlling (take a look at carla.World if you are yet to learn on how to spawn actors). They also need for a special blueprint (already defined in carla.BlueprintLibrary as "controller.ai.walker"). This is an empty blueprint, as the AI controller will be invisible in the simulation but will follow its parent around to dictate every step of the way.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: start
|
||||
doc: >
|
||||
Initializes walker controller.
|
||||
Enables AI control for its parent walker.
|
||||
# --------------------------------------
|
||||
- def_name: stop
|
||||
doc: >
|
||||
Stops walker controller.
|
||||
Disables AI control for its parent walker.
|
||||
# --------------------------------------
|
||||
- def_name: go_to_location
|
||||
params:
|
||||
|
@ -354,36 +299,34 @@
|
|||
type: float
|
||||
default: 1.4
|
||||
doc: >
|
||||
Speed is in m/s.
|
||||
speed in m/s. An easy walking speed is set by default.
|
||||
doc: >
|
||||
Sets the speed of the pedestrian.
|
||||
Sets a speed for the walker in meters per second.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: TrafficSign
|
||||
parent: carla.Actor
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
A traffic sign actor.
|
||||
Traffic signs appearing in the simulation except for traffic lights. These have their own class inherited from this in carla.TrafficLight. Right now, speed signs, stops and yields are mainly the ones implemented, but many others are borne in mind.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: trigger_volume
|
||||
doc: >
|
||||
A carla.BoundingBox situated near a traffic sign where the
|
||||
carla.Actor who is inside can know about its state.
|
||||
A carla.BoundingBox situated near a traffic sign where the carla.Actor who is inside can know about it.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: TrafficLightState
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
All possible states for traffic lights. Check out this [`recipe`](../python_cookbook/#traffic-lights-recipe)!
|
||||
All possible states for traffic lights. These can either change at a specific time step or be changed manually. Take a look at this [recipe](../python_cookbook/#traffic-lights-recipe) to see an example.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: Green
|
||||
- var_name: Red
|
||||
- var_name: Yellow
|
||||
- var_name: Green
|
||||
- var_name: 'Off'
|
||||
- var_name: Unknown
|
||||
# --------------------------------------
|
||||
|
@ -392,83 +335,17 @@
|
|||
parent: carla.TrafficSign
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
A traffic light actor. Check out this [`recipe`](../python_cookbook/#traffic-lights-recipe)!
|
||||
A traffic light actor, considered a specific type of traffic sign. As traffic lights will mostly appear at junctions, they belong to a group which contains the different traffic lights in it. Inside the group, traffic lights are differenciated by their pole index.
|
||||
|
||||
Within a group the state of traffic lights is changed in a cyclic pattern: one index is chosen and it spends a few seconds in green, yellow and eventually red. The rest of the traffic lights remain frozen in red this whole time, meaning that there is a gap in the last seconds of the cycle where all the traffic lights are red. However, the state of a traffic light can be changed manually. Take a look at this [recipe](../python_cookbook/#traffic-lights-recipe) to learn how to do so.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: state
|
||||
type: carla.TrafficLightState
|
||||
doc: >
|
||||
Current traffic light state.
|
||||
Current state of the traffic light.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: set_state
|
||||
params:
|
||||
- param_name: state
|
||||
type: carla.TrafficLightState
|
||||
doc: >
|
||||
Sets a given state to a traffic light actor.
|
||||
# --------------------------------------
|
||||
- def_name: get_state
|
||||
return: carla.TrafficLightState
|
||||
doc: >
|
||||
Returns the current state of the traffic light.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data
|
||||
received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: set_green_time
|
||||
params:
|
||||
- param_name: green_time
|
||||
type: float
|
||||
doc: >
|
||||
Sets a given time (in seconds) to the green state to be active.
|
||||
# --------------------------------------
|
||||
- def_name: get_green_time
|
||||
return: float
|
||||
doc: >
|
||||
Returns the current time set for the green light to be active.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data
|
||||
received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: set_yellow_time
|
||||
params:
|
||||
- param_name: yellow_time
|
||||
type: float
|
||||
doc: >
|
||||
Sets a given time (in seconds) to the yellow state to be active.
|
||||
# --------------------------------------
|
||||
- def_name: get_yellow_time
|
||||
return: float
|
||||
doc: >
|
||||
Returns the current time set for the yellow light to be active.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data
|
||||
received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: set_red_time
|
||||
params:
|
||||
- param_name: red_time
|
||||
type: float
|
||||
doc: >
|
||||
Sets a given time (in seconds) to the red state to be active.
|
||||
# --------------------------------------
|
||||
- def_name: get_red_time
|
||||
return: float
|
||||
doc: >
|
||||
Returns the current time set for the red light to be active.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data
|
||||
received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_elapsed_time
|
||||
return: float
|
||||
doc: >
|
||||
Returns the current countdown of the state of a traffic light.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data
|
||||
received in the last tick.
|
||||
# --------------------------------------
|
||||
- def_name: freeze
|
||||
params:
|
||||
- param_name: freeze
|
||||
|
@ -479,24 +356,73 @@
|
|||
- def_name: is_frozen
|
||||
return: bool
|
||||
doc: >
|
||||
Returns `True` if a traffic light is frozen.
|
||||
note: >
|
||||
This function does not call the simulator, it returns the data
|
||||
received in the last tick.
|
||||
The client returns <b>True</b> if a traffic light is frozen according to last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_pole_index
|
||||
return: int
|
||||
doc: >
|
||||
Returns the index of the pole in the traffic light group.
|
||||
Returns the index of the pole that identifies it as part of the traffic light group of a junction.
|
||||
# --------------------------------------
|
||||
- def_name: get_group_traffic_lights
|
||||
return: list(carla.TrafficLight)
|
||||
doc: >
|
||||
Returns all traffic lights in the group this one belongs to.
|
||||
Returns all traffic lights in the group this one belongs to.
|
||||
note: >
|
||||
This function calls the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
- def_name: get_elapsed_time
|
||||
return: float
|
||||
doc: >
|
||||
The client returns the time in seconds since current light state started according to last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_state
|
||||
return: carla.TrafficLightState
|
||||
doc: >
|
||||
The client returns the state of the traffic light according to last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_green_time
|
||||
return: float
|
||||
doc: >
|
||||
The client returns the seconds set for the traffic light to be green according to last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_red_time
|
||||
return: float
|
||||
doc: >
|
||||
The client returns the seconds set for the traffic light to be red according to last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: get_yellow_time
|
||||
return: float
|
||||
doc: >
|
||||
The client returns the the seconds set for the traffic light to be yellow according to last tick. The method does not call the simulator.
|
||||
# --------------------------------------
|
||||
- def_name: set_state
|
||||
params:
|
||||
- param_name: state
|
||||
type: carla.TrafficLightState
|
||||
doc: >
|
||||
Sets a given state to a traffic light actor.
|
||||
# --------------------------------------
|
||||
- def_name: set_green_time
|
||||
params:
|
||||
- param_name: green_time
|
||||
type: float
|
||||
doc: >
|
||||
Sets a given time (in seconds) for the green light to be active.
|
||||
# --------------------------------------
|
||||
- def_name: set_red_time
|
||||
params:
|
||||
- param_name: red_time
|
||||
type: float
|
||||
doc: >
|
||||
Sets a given time (in seconds) for the red state to be active.
|
||||
# --------------------------------------
|
||||
- def_name: set_yellow_time
|
||||
params:
|
||||
- param_name: yellow_time
|
||||
type: float
|
||||
doc: >
|
||||
Sets a given time (in seconds) for the yellow light to be active.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
|
@ -6,42 +6,37 @@
|
|||
- class_name: ActorAttributeType
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines the type of attribute of a carla.ActorAttribute.
|
||||
CARLA provides a library of blueprints for actors in carla.BlueprintLibrary with different attributes each. This class defines the types those at carla.ActorAttribute can be as a series of enum. All this information is managed internally and listed here for a better comprehension of how CARLA works.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: Bool
|
||||
doc: >
|
||||
- var_name: Int
|
||||
doc: >
|
||||
- var_name: Float
|
||||
doc: >
|
||||
- var_name: String
|
||||
doc: >
|
||||
- var_name: RGBColor
|
||||
doc: >
|
||||
- var_name: String
|
||||
|
||||
- class_name: Color
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines a 32-bit BGRA color.
|
||||
Class that defines a 32-bit RGBA color.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: r
|
||||
type: int
|
||||
doc: >
|
||||
Red color (0-255)
|
||||
Red color (0-255).
|
||||
- var_name: g
|
||||
type: int
|
||||
doc: >
|
||||
Green color (0-255)
|
||||
Green color (0-255).
|
||||
- var_name: b
|
||||
type: int
|
||||
doc: >
|
||||
Blue color (0-255)
|
||||
Blue color (0-255).
|
||||
- var_name: a
|
||||
type: int
|
||||
doc: >
|
||||
Alpha channel (0-255)
|
||||
Alpha channel (0-255).
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -49,124 +44,151 @@
|
|||
- param_name: r
|
||||
type: int
|
||||
default: 0
|
||||
doc: >
|
||||
- param_name: g
|
||||
type: int
|
||||
default: 0
|
||||
doc: >
|
||||
- param_name: b
|
||||
type: int
|
||||
default: 0
|
||||
doc: >
|
||||
- param_name: a
|
||||
type: int
|
||||
default: 255
|
||||
doc: >
|
||||
doc: >
|
||||
Client constructor
|
||||
Initializes a color, black by default.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Color
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Color
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ActorAttribute
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines an attribute of a carla.ActorBlueprint.
|
||||
CARLA provides a library of blueprints for actors that can be accessed as carla.BlueprintLibrary. Each of these blueprints has a series of attributes defined internally. Some of these are modifiable, others are not. A list of recommended values is provided for those that can be set.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: id
|
||||
type: str
|
||||
doc: >
|
||||
The attribute's identifier
|
||||
The attribute's name and identifier in the library.
|
||||
- var_name: type
|
||||
type: carla.ActorAttributeType
|
||||
doc: >
|
||||
The attribute parameter type
|
||||
The attribute's parameter type.
|
||||
- var_name: recommended_values
|
||||
type: list(str)
|
||||
doc: >
|
||||
List of recommended values that the attribute may have.
|
||||
A list of values suggested by those who designed the blueprint.
|
||||
- var_name: is_modifiable
|
||||
type: bool
|
||||
doc: >
|
||||
True if the attribute is modifiable.
|
||||
It is <b>True</b> if the attribute's value can be modified.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: as_bool
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: as_int
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: as_float
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: as_str
|
||||
doc: >
|
||||
Reads the attribute as boolean value.
|
||||
# --------------------------------------
|
||||
- def_name: as_color
|
||||
doc: >
|
||||
Reads the attribute as carla.Color.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
- param_name: other
|
||||
type: bool / int / float / str / carla.Color / carla.ActorAttribute
|
||||
- def_name: as_int
|
||||
doc: >
|
||||
Reads the attribute as int.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
type: bool / int / float / str / carla.Color / carla.ActorAttribute
|
||||
- def_name: as_float
|
||||
doc: >
|
||||
Reads the attribute as float.
|
||||
# --------------------------------------
|
||||
- def_name: __nonzero__
|
||||
- def_name: as_str
|
||||
doc: >
|
||||
Reads the attribute as string.
|
||||
# --------------------------------------
|
||||
- def_name: __bool__
|
||||
doc: >
|
||||
Internal method to manage the attribute as bool.
|
||||
# --------------------------------------
|
||||
- def_name: __int__
|
||||
doc: >
|
||||
Internal method to manage the attribute as int.
|
||||
# --------------------------------------
|
||||
- def_name: __float__
|
||||
doc: >
|
||||
Internal method to manage the attribute as float.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
Parses the attribute ID and its value to string.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
- def_name: __eq__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: bool / int / float / str / carla.Color / carla.ActorAttribute
|
||||
doc: >
|
||||
Returns true if this actor's attribute and `other` are the same.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: bool / int / float / str / carla.Color / carla.ActorAttribute
|
||||
doc: >
|
||||
Returns true if this actor's attribute and `other` are different.
|
||||
# --------------------------------------
|
||||
- def_name: __nonzero__
|
||||
return: bool
|
||||
doc: >
|
||||
Returns true if this actor's attribute is not zero or null.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ActorBlueprint
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that contains all the necessary information for spawning an Actor.
|
||||
CARLA provides a blueprint library for actors that can be consulted through carla.BlueprintLibrary. Each of these consists of an identifier for the blueprint and a series of attributes that may be modifiable or not. This class is the intermediate step between the library and the actor creation. Actors need an actor blueprint to be spawned. These store the information for said blueprint in an object with its attributes and some tags to categorize them. The user can then customize some attributes and eventually spawn the actors through carla.World.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: id
|
||||
type: str
|
||||
doc: >
|
||||
Actor blueprint identifier, e.g. `walker.pedestrian.0001`.
|
||||
The identifier of said blueprint inside the library. E.g. `walker.pedestrian.0001`.
|
||||
- var_name: tags
|
||||
type: list(str)
|
||||
doc: >
|
||||
List of tags of an actor blueprint e.g. `['0001', 'pedestrian', 'walker']`
|
||||
A list of tags each blueprint has that helps describing them. E.g. `['0001', 'pedestrian', 'walker']`.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __iter__
|
||||
doc: >
|
||||
Allows iteration within this class.
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
doc: >
|
||||
Returns the amount of attributes for this blueprint.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
Parses the information of this blueprint to string.
|
||||
# --------------------------------------
|
||||
- def_name: has_attribute
|
||||
return: bool
|
||||
params:
|
||||
- param_name: id
|
||||
type: str
|
||||
doc: >
|
||||
e.g. `gender` would return **True** for pedestrians' blueprints.
|
||||
doc: >
|
||||
Returns <b>True</b> if the blueprint contains the attribute `id`.
|
||||
# --------------------------------------
|
||||
- def_name: has_tag
|
||||
return: bool
|
||||
params:
|
||||
|
@ -175,7 +197,7 @@
|
|||
doc: >
|
||||
e.g. 'walker'
|
||||
doc: >
|
||||
Returns `true` if an actor blueprint has the tag.
|
||||
Returns <b>True</b> if the blueprint has the specified `tag` listed.
|
||||
# --------------------------------------
|
||||
- def_name: match_tags
|
||||
return: bool
|
||||
|
@ -183,19 +205,7 @@
|
|||
- param_name: wildcard_pattern
|
||||
type: str
|
||||
doc: >
|
||||
Test if any of the flags or id matches wildcard_pattern.
|
||||
note: >
|
||||
The wildcard_pattern follows Unix shell-style wildcards.
|
||||
# --------------------------------------
|
||||
- def_name: has_attribute
|
||||
return: bool
|
||||
params:
|
||||
- param_name: id
|
||||
type: str
|
||||
doc: >
|
||||
e.g 'gender'
|
||||
doc: >
|
||||
Returns `true` if the blueprint contains the specified attribute
|
||||
Returns <b>True</b> if any of the tags listed for this blueprint matches `wildcard_pattern`. Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
|
||||
# --------------------------------------
|
||||
- def_name: get_attribute
|
||||
return: carla.ActorAttribute
|
||||
|
@ -203,7 +213,7 @@
|
|||
- param_name: id
|
||||
type: str
|
||||
doc: >
|
||||
Returns the current actor attribute through its id
|
||||
Returns the actor's attribute with `id` as identifier if existing.
|
||||
Return: carla.ActorAttribute
|
||||
# --------------------------------------
|
||||
- def_name: set_attribute
|
||||
|
@ -211,64 +221,59 @@
|
|||
- param_name: id
|
||||
type: str
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
The identifier for the attribute that is intended to be changed.
|
||||
- param_name: value
|
||||
type: str
|
||||
doc: >
|
||||
The new value for said attribute.
|
||||
doc: >
|
||||
Sets an existing attribute to the actor's blueprint
|
||||
note: >
|
||||
Attribute can only be set or changed if it is modifiable
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __iter__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
If the `id` attribute is modifiable, changes its value to `value`.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: BlueprintLibrary
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that provides access to [blueprints](../bp_library/).
|
||||
A class that contains the blueprints provided for actor spawning. Its main application is to return carla.ActorBlueprint objects needed to spawn actors. Each blueprint has an identifier and attributes that may or may not be modifiable. The library is automatically created by the server and can be accessed through carla.World.
|
||||
|
||||
[Here](../bp_library/) is a reference containing every available blueprint and its specifics.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: find
|
||||
params:
|
||||
- param_name: id
|
||||
type: str
|
||||
return: carla.ActorBlueprint
|
||||
doc: >
|
||||
Returns a carla.ActorBlueprint through its id
|
||||
# --------------------------------------
|
||||
- def_name: filter
|
||||
params:
|
||||
- param_name: wildcard_pattern
|
||||
type: str
|
||||
doc: >
|
||||
Filters a list of ActorBlueprint with id or tags matching wildcard_pattern.
|
||||
The pattern is matched against each blueprint's id and tags.
|
||||
note: >
|
||||
The wildcard_pattern follows Unix shell-style wildcards (fnmatch).
|
||||
return: carla.BlueprintLibrary
|
||||
# --------------------------------------
|
||||
- def_name: __getitem__
|
||||
params:
|
||||
- param_name: pos
|
||||
type: int
|
||||
return: carla.ActorBlueprint
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
doc: >
|
||||
Returns the blueprint stored in `pos` position inside the data structure containing them.
|
||||
# --------------------------------------
|
||||
- def_name: __iter__
|
||||
doc: >
|
||||
Method that allows iteration of this class.
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
return: int
|
||||
doc: >
|
||||
Returns the amount of blueprints comprising the library.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: string
|
||||
doc: >
|
||||
Parses the identifiers for every blueprint to string.
|
||||
# --------------------------------------
|
||||
- def_name: filter
|
||||
params:
|
||||
- param_name: wildcard_pattern
|
||||
type: str
|
||||
doc: >
|
||||
Filters a list of blueprints matching the `wildcard_pattern` against the id and tags of every blueprint contained in this library and returns the result as a new one. Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
|
||||
return: carla.BlueprintLibrary
|
||||
# --------------------------------------
|
||||
- def_name: find
|
||||
params:
|
||||
- param_name: id
|
||||
type: str
|
||||
return: carla.ActorBlueprint
|
||||
doc: >
|
||||
Returns the blueprint corresponding to that identifier.
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
---
|
||||
- module_name: carla
|
||||
doc: >
|
||||
|
||||
# - CLASSES ------------------------------
|
||||
classes:
|
||||
- class_name: Client
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Client used to connect to a Carla server
|
||||
The Client connects CARLA to the server which runs the simulation. Both server and client contain a CARLA library (libcarla) with some differences that allow communication between them. Many clients can be created and each of these will connect to the RPC server inside the simulation to send commands. The simulation runs server-side. Once the connection is established, the client will only receive data retrieved from the simulation. Walkers are the exception. The client is in charge of managing pedestrians so, if you are running a simulation with multiple clients, some issues may arise. For example, if you spawn walkers through different clients, collisions may happen, as each client is only aware of the ones it is in charge of.
|
||||
|
||||
The client also has a recording feature that saves all the information of a simulation while running it. This allows the server to replay it at will to obtain information and experiment with it. [Here](recorder_and_playback.md) is some information about how to use this recorder.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
# - METHODS ----------------------------
|
||||
|
@ -15,12 +18,14 @@
|
|||
params:
|
||||
- param_name: host
|
||||
type: str
|
||||
default: '127.0.0.1'
|
||||
doc: >
|
||||
IP address where a CARLA Simulator instance is running
|
||||
IP address where a CARLA Simulator instance is running. Default is localhost (127.0.0.1).
|
||||
- param_name: port
|
||||
type: int
|
||||
default: 2000
|
||||
doc: >
|
||||
TCP port where the CARLA Simulator instance is running
|
||||
TCP port where the CARLA Simulator instance is running. Default are 2000 and the subsequent 2001.
|
||||
- param_name: worker_threads
|
||||
type: int
|
||||
default: 0
|
||||
|
@ -30,120 +35,128 @@
|
|||
doc: >
|
||||
Client constructor
|
||||
# --------------------------------------
|
||||
- def_name: set_timeout
|
||||
- def_name: apply_batch
|
||||
params:
|
||||
- param_name: seconds
|
||||
type: float
|
||||
- param_name: commands
|
||||
type: list
|
||||
doc: >
|
||||
New timeout value in seconds
|
||||
A list of commands to execute in batch. Each command is different and has its own parameters. These are supported so far:
|
||||
[SpawnActor](#command.SpawnActor)
|
||||
[DestroyActor](#command.DestroyActor)
|
||||
[ApplyVehicleControl](#command.ApplyVehicleControl)
|
||||
[ApplyWalkerControl](#command.ApplyWalkerControl)
|
||||
[ApplyTransform](#command.ApplyTransform)
|
||||
[ApplyVelocity](#command.ApplyVelocity)
|
||||
[ApplyAngularVelocity](#command.ApplyAngularVelocity)
|
||||
[ApplyImpulse](#command.ApplyImpulse)
|
||||
[SetSimulatePhysics](#command.SetSimulatePhysics)
|
||||
[SetAutopilot](#command.SetAutopilot)
|
||||
doc: >
|
||||
Set the timeout in seconds allowed to block when doing networking calls
|
||||
Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the **<font color="#7fb800">apply_batch_sync()</font>** function right below this one.
|
||||
[Here](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L126) is an example on how to delete the actors that appear in carla.ActorList all at once.
|
||||
# --------------------------------------
|
||||
- def_name: get_client_version
|
||||
- def_name: apply_batch_sync
|
||||
params:
|
||||
return: str
|
||||
- param_name: commands
|
||||
type: list
|
||||
doc: >
|
||||
A list of commands to execute in batch. The commands available are listed right above, in the function **<font color="#7fb800">apply_batch()</font>**.
|
||||
- param_name: due_tick_cue
|
||||
type: bool
|
||||
doc: >
|
||||
A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_.
|
||||
return: list(command.Response)
|
||||
doc: >
|
||||
Get the client version as a string
|
||||
# --------------------------------------
|
||||
- def_name: get_server_version
|
||||
params:
|
||||
return: str
|
||||
doc: >
|
||||
Get the server version as a string
|
||||
# --------------------------------------
|
||||
- def_name: get_world
|
||||
params:
|
||||
return: carla.World
|
||||
doc: >
|
||||
Get the world currently active in the simulation
|
||||
Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of <b>command.Response</b> that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L112-L116) is an example of it being used to spawn actors.
|
||||
# --------------------------------------
|
||||
- def_name: get_available_maps
|
||||
params:
|
||||
return: list(str)
|
||||
doc: >
|
||||
Get a list of strings of the maps available on server. The result can be something like:
|
||||
'/Game/Carla/Maps/Town01'
|
||||
'/Game/Carla/Maps/Town02'
|
||||
'/Game/Carla/Maps/Town03'
|
||||
'/Game/Carla/Maps/Town04'
|
||||
'/Game/Carla/Maps/Town05'
|
||||
'/Game/Carla/Maps/Town06'
|
||||
'/Game/Carla/Maps/Town07'
|
||||
Returns a list of strings containing the paths of the maps available on server. These paths are dynamic, they will be created during the simulation and so you will not find them when looking up in your files. One of the possible returns for this method would be:
|
||||
['/Game/Carla/Maps/Town01',
|
||||
'/Game/Carla/Maps/Town02',
|
||||
'/Game/Carla/Maps/Town03',
|
||||
'/Game/Carla/Maps/Town04',
|
||||
'/Game/Carla/Maps/Town05',
|
||||
'/Game/Carla/Maps/Town06',
|
||||
'/Game/Carla/Maps/Town07']
|
||||
# --------------------------------------
|
||||
- def_name: reload_world
|
||||
- def_name: get_client_version
|
||||
params:
|
||||
raises: RuntimeError
|
||||
return: str
|
||||
doc: >
|
||||
Reload the current world, note that a new world is created with default
|
||||
settings using the same map. All actors present in the world will be
|
||||
destroyed.
|
||||
Returns the client libcarla version by consulting it in the "Version.h" file. Both client and server can use different libcarla versions but some issues may arise regarding unexpected incompatibilities.
|
||||
# --------------------------------------
|
||||
- def_name: get_server_version
|
||||
params:
|
||||
return: str
|
||||
doc: >
|
||||
Returns the server libcarla version by consulting it in the "Version.h" file. Both client and server should use the same libcarla version.
|
||||
# --------------------------------------
|
||||
- def_name: get_world
|
||||
params:
|
||||
return: carla.World
|
||||
doc: >
|
||||
Returns the world object currently active in the simulation. This world will be later used for example to load maps.
|
||||
# --------------------------------------
|
||||
- def_name: load_world
|
||||
params:
|
||||
- param_name: map_name
|
||||
type: str
|
||||
doc: >
|
||||
Name of the map to load, accepts both full paths and map names, e.g.
|
||||
'/Game/Carla/Maps/Town01' or 'Town01'.
|
||||
Name of the map to be used in this world. Accepts both full paths and map names, e.g.
|
||||
'/Game/Carla/Maps/Town01' or 'Town01'. Remember that these paths are dynamic.
|
||||
doc: >
|
||||
Load a new world with default settings using `map_name` map. All actors
|
||||
present in the current world will be destroyed.
|
||||
Creates a new world with default settings using `map_name` map. All actors in the current world will be destroyed.
|
||||
# --------------------------------------
|
||||
- def_name: start_recorder
|
||||
- def_name: reload_world
|
||||
params:
|
||||
- param_name: filename
|
||||
raises: RuntimeError when corresponding.
|
||||
doc: >
|
||||
Deletes the current world and creates a new one using the same map and default settings. Every actor in the previous world will be
|
||||
destroyed.
|
||||
# --------------------------------------
|
||||
- def_name: replay_file
|
||||
params:
|
||||
- param_name: name
|
||||
type: str
|
||||
doc: >
|
||||
Name of the file to write the recorded data
|
||||
Name of the file containing the information of the simulation.
|
||||
- param_name: start
|
||||
type: float
|
||||
doc: >
|
||||
Time in seconds where to start playing the simulation. Negative is read as beginning from the end, being -10 just 10 seconds before the recording finished.
|
||||
- param_name: duration
|
||||
type: float
|
||||
doc: >
|
||||
Time in seconds that will be reenacted using the information `name` file. If the end is reached, the simulation will continue.
|
||||
- param_name: follow_id
|
||||
type: int
|
||||
doc: >
|
||||
ID of the actor to follow. If this is 0 then camera is disabled.
|
||||
doc: >
|
||||
If we use a simple name like 'recording.log' then it will be saved at server folder 'CarlaUE4/Saved/recording.log'.
|
||||
If we use some folder in the name, then it will be considered to be an absolute path, like '/home/carla/recording.log'.
|
||||
The server will start running the simulation `name` previously recorded. The time to start and stop can be stated and if the recreation finishes, the vehicles will continue their behaviour as usual, managed by the server. During the simulation we can follow a specific actor using its ID.
|
||||
# --------------------------------------
|
||||
- def_name: stop_recorder
|
||||
- def_name: set_replayer_time_factor
|
||||
params:
|
||||
- param_name: time_factor
|
||||
type: float
|
||||
default: 1.0
|
||||
doc: >
|
||||
1.0 means normal time speed. Greater than 1.0 means fast motion (2.0 would be double speed) and lesser means slow motion (0.5 would be half speed).
|
||||
doc: >
|
||||
Stops the recording in progress.
|
||||
When used, the time speed of the reenacted simulation is modified at will. It can be used several times while a playback is in curse.
|
||||
# --------------------------------------
|
||||
- def_name: show_recorder_file_info
|
||||
- def_name: set_timeout
|
||||
params:
|
||||
- param_name: filename
|
||||
type: str
|
||||
- param_name: seconds
|
||||
type: float
|
||||
doc: >
|
||||
Name of the recorded file to load
|
||||
- param_name: show_all
|
||||
type: bool
|
||||
doc: >
|
||||
Show all detailed info, or just a summary
|
||||
New timeout value in seconds. Default is 5 seconds.
|
||||
doc: >
|
||||
Will show info about the recorded file (frames, times, events, state, positions...)
|
||||
We have the option to show all the details per frame, that includes all the traffic light states, position of all actors, and animations data.
|
||||
# --------------------------------------
|
||||
- def_name: show_recorder_collisions
|
||||
params:
|
||||
- param_name: filename
|
||||
type: str
|
||||
doc: >
|
||||
Name of the recorded file to load
|
||||
- param_name: category1
|
||||
type: single char
|
||||
doc: >
|
||||
Character specifying the category of the first actor
|
||||
- param_name: category2
|
||||
type: single char
|
||||
doc: >
|
||||
Character specifying the category of the second actor
|
||||
doc: >
|
||||
This will show which collisions were recorded in the file. We can use a filter for the collisions we want, using two categories.
|
||||
The categories can be:
|
||||
'h' = Hero
|
||||
'v' = Vehicle
|
||||
'w' = Walker
|
||||
't' = Traffic light
|
||||
'o' = Other
|
||||
'a' = Any
|
||||
So, if you want to see only collisions about a vehicle and a walker, we would use for category1 'v' and category2 'w'.
|
||||
Or if you want all the collisions (filter off) you can use 'a' as both categories.
|
||||
# --------------------------------------
|
||||
Sets in seconds the maxixum time a network call is allowed before blocking it and raising a timeout exceeded error.
|
||||
# --------------------------------------
|
||||
- def_name: show_recorder_actors_blocked
|
||||
params:
|
||||
- param_name: filename
|
||||
|
@ -153,87 +166,66 @@
|
|||
- param_name: min_time
|
||||
type: float
|
||||
doc: >
|
||||
How many seconds has to be stoped an actor to be considered as blocked
|
||||
Minimum time in seconds the actor has to move a minimum distance before being considered blocked. Default is 60 seconds.
|
||||
- param_name: min_distance
|
||||
type: float
|
||||
doc: >
|
||||
How many centimeters needs to move the actor in order to be considered as moving, and not blocked
|
||||
Minimum distance in centimeters the actor has to move to not be considered blocked. Default is 100 centimeters.
|
||||
doc: >
|
||||
Shows which actors seem blocked by some reason.
|
||||
The idea is to calculate which actors are not moving as much as 'min_distance' for a period of 'min_time'.
|
||||
By default min_time = 60 seconds (1 min) and min_distance = 100 centimeters (1 m).
|
||||
# --------------------------------------
|
||||
- def_name: replay_file
|
||||
The terminal will show the information registered for actors considered blocked. An actor is considered blocked when it does not move a minimum distance in a period of time, being these `min_distance` and `min_time`.
|
||||
# --------------------------------------
|
||||
- def_name: show_recorder_collisions
|
||||
params:
|
||||
- param_name: name
|
||||
- param_name: filename
|
||||
type: str
|
||||
doc: >
|
||||
Name of the file.
|
||||
- param_name: start
|
||||
type: float
|
||||
Name or absolute path of the file recorded, depending on your previous choice.
|
||||
- param_name: category1
|
||||
type: single char
|
||||
doc: >
|
||||
Time in seconds where to start the playback. If it is negative, then it starts from the end.
|
||||
- param_name: duration
|
||||
type: float
|
||||
doc: >
|
||||
Id of the actor to follow. If this is 0 then camera is disabled
|
||||
- param_name: follow_id
|
||||
type: int
|
||||
Character variable specifying a first type of actor involved in the collision.
|
||||
- param_name: category2
|
||||
type: single char
|
||||
doc: >
|
||||
Character variable specifying the second type of actor involved in the collision.
|
||||
doc: >
|
||||
Playback a file
|
||||
The terminal will show the collisions registered by the recorder. These can be filtered by specifying the type of actor involved.
|
||||
The categories will be specified in `category1` and `category2` as follows:
|
||||
'h' = Hero, the one vehicle that can be controlled manually or managed by the user.
|
||||
'v' = Vehicle
|
||||
'w' = Walker
|
||||
't' = Traffic light
|
||||
'o' = Other
|
||||
'a' = Any
|
||||
If you want to see only collisions between a vehicles and a walkers, use for `category1` as 'v' and `category2` as 'w' or vice versa.
|
||||
If you want to see all the collisions (filter off) you can use 'a' for both parameters.
|
||||
# --------------------------------------
|
||||
- def_name: set_replayer_time_factor
|
||||
- def_name: show_recorder_file_info
|
||||
params:
|
||||
- param_name: time_factor
|
||||
type: float
|
||||
doc: >
|
||||
A value of 1.0 means normal time factor.
|
||||
A value < 1.0 means slow motion (for example 0.5 is half speed)
|
||||
A value > 1.0 means fast motion (for example 2.0 is double speed)
|
||||
doc: >
|
||||
Apply a different playback speed to current playback. Can be used several times while a playback is in curse.
|
||||
# --------------------------------------
|
||||
- def_name: apply_batch
|
||||
params:
|
||||
- param_name: commands
|
||||
type: list
|
||||
doc: >
|
||||
A list of commands to execute in batch. Each command has a different number of parameters.
|
||||
Currently, we can use these [commands](#command.ApplyAngularVelocity):
|
||||
SpawnActor
|
||||
DestroyActor
|
||||
ApplyVehicleControl
|
||||
ApplyWalkerControl
|
||||
ApplyTransform
|
||||
ApplyVelocity
|
||||
AplyAngularVelocity
|
||||
ApplyImpulse
|
||||
SetSimulatePhysics
|
||||
SetAutopilot
|
||||
doc: >
|
||||
This function executes the whole list of commands on a single simulation step.
|
||||
For example, to set autopilot on some actors, we could use:
|
||||
[sample_code](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L126).
|
||||
We don't have control about the response of each command. If we need that, we can use `apply_batch_sync()`.
|
||||
|
||||
# --------------------------------------
|
||||
- def_name: apply_batch_sync
|
||||
params:
|
||||
- param_name: commands
|
||||
type: list
|
||||
doc: >
|
||||
A list of commands to execute in batch. For a list of commands available see function above apply_batch().
|
||||
- param_name: due_tick_cue
|
||||
- param_name: filename
|
||||
type: str
|
||||
doc: >
|
||||
Name or absolute path of the file recorded, depending on your previous choice.
|
||||
- param_name: show_all
|
||||
type: bool
|
||||
default: false
|
||||
doc: >
|
||||
A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_.
|
||||
return: list
|
||||
When true, will show all the details per frame (traffic light states, positions of all actors, orientation and animation data...), but by default it will only show a summary.
|
||||
doc: >
|
||||
This function executes the whole list of commands on a single simulation
|
||||
step, blocks until the commands are executed, and returns a list of
|
||||
[`command.Response`](#command.Response) that can be used to determine whether a single
|
||||
command succeeded or not.
|
||||
[sample_code](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L112-L116)
|
||||
The information saved by the recorder will be parsed and shown in your terminal as text (frames, times, events, state, positions...). The information shown can be specified by using the `show_all` parameter. [Here](recorder_binary_file_format.md) is some more information about how to read the recorder file.
|
||||
# --------------------------------------
|
||||
- def_name: start_recorder
|
||||
params:
|
||||
- param_name: filename
|
||||
type: str
|
||||
doc: >
|
||||
Name of the file to write the recorded data. A simple name will save the recording in 'CarlaUE4/Saved/recording.log'. Otherwise, if some folder appears in the name, it will be considered an absolute path.
|
||||
doc: >
|
||||
Enables the recording feature, which will start saving every information possible needed by the server to replay the simulation.
|
||||
# --------------------------------------
|
||||
- def_name: stop_recorder
|
||||
params:
|
||||
doc: >
|
||||
Stops the recording in progress. If you specified a path in `filename`, the recording will be there. If not, look inside `CarlaUE4/Saved/`.
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
|
@ -5,43 +5,44 @@
|
|||
- class_name: Response
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Execution result of a command, contains either an error string or an
|
||||
actor ID, depending on whether or not the command succeeded. See carla.Client.apply_batch_sync
|
||||
States the result of executing a command as either the ID of the actor to whom the command was applied to (when succeeded) or an error string (when failed).
|
||||
actor ID, depending on whether or not the command succeeded. The method **<font color="#7fb800">apply_batch_sync()</font>** in carla.Client returns a list of these to summarize the execution of a batch.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Actor affected by the command
|
||||
Actor to whom the command was applied to. States that the command was successful.
|
||||
- var_name: error
|
||||
type: str
|
||||
doc: >
|
||||
A string stating the command has failed.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: has_error
|
||||
return: bool
|
||||
params:
|
||||
doc: >
|
||||
Returns <b>True</b> if the command represents a successful execution and <b>False</b> if not.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: SpawnActor
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Spawn an actor into the world based on the blueprint provided and the transform.
|
||||
If a parent is provided, the actor is attached to parent.
|
||||
Command adaptation of **<font color="#7fb800">spawn_actor()</font>** in carla.World. Spawns an actor into the world based on the blueprint provided and the transform. If a parent is provided, the actor is attached to it.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
Transform to be applied
|
||||
Transform to be applied.
|
||||
- var_name: parent_id
|
||||
type: int
|
||||
doc: >
|
||||
Parent's actor id
|
||||
Identificator of the parent actor.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __init__
|
||||
params:
|
||||
|
@ -49,7 +50,6 @@
|
|||
type: carla.ActorBlueprint
|
||||
- param_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __init__
|
||||
params:
|
||||
|
@ -59,7 +59,6 @@
|
|||
type: carla.Transform
|
||||
- param_name: parent
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: then
|
||||
params:
|
||||
|
@ -68,15 +67,13 @@
|
|||
doc: >
|
||||
CommandType.
|
||||
doc: >
|
||||
Link another command to be executed right after.
|
||||
Links another command to be executed right after. It allows to ease very common flows such as spawning a set of vehicles by command and then using this method to set them to autopilot automatically.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: DestroyActor
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Tell the simulator to destroy this Actor, and return whether the actor was
|
||||
successfully destroyed. It has no effect if the Actor was already
|
||||
successfully destroyed.
|
||||
Command adaptation of **<font color="#7fb800">destroy()</font>** in carla.Actor that tells the simulator to destroy this actor. It has no effect if the actor was already destroyed. When executed with **<font color="#7fb800">apply_batch_synch()</font>** in carla.Client there will be a <b>command.Response</b> that will return a boolean stating whether the actor was successfully destroyed.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
|
@ -89,120 +86,124 @@
|
|||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ApplyVehicleControl
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Apply control to the vehicle.
|
||||
Command adaptation of **<font color="#7fb800">apply_control()</font>** in carla.Vehicle. Applies a certain control to a vehicle.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Vehicle actor affected by the command
|
||||
Vehicle actor affected by the command.
|
||||
- var_name: control
|
||||
type: carla.VehicleControl
|
||||
doc: >
|
||||
Vehicle control to be applied
|
||||
Vehicle control to be applied.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
- param_name: control
|
||||
type: carla.VehicleControl
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ApplyWalkerControl
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Apply control to the walker
|
||||
Command adaptation of **<font color="#7fb800">apply_control()</font>** in carla.Walker. Applies a control to a walker.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Walker actor affected by the command
|
||||
Walker actor affected by the command.
|
||||
- var_name: control
|
||||
type: carla.VehicleControl
|
||||
type: carla.WalkerControl
|
||||
doc: >
|
||||
Walker control to be applied
|
||||
Walker control to be applied.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
- param_name: control
|
||||
type: carla.WalkerControl
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ApplyTransform
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Sets a new transform to the actor.
|
||||
Command adaptation of **<font color="#7fb800">set_transform()</font>** in carla.Actor. Sets a new transform to an actor.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Actor affected by the command
|
||||
Actor affected by the command.
|
||||
- var_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
Transformation to be applied
|
||||
Transformation to be applied.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
- param_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ApplyWalkerState
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Apply a state to the walker actor
|
||||
Apply a state to the walker actor. Specially useful to initialize an actor them with a specific location, orientation and speed.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Walker actor affected by the command
|
||||
Walker actor affected by the command.
|
||||
- var_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
Transform to be applied
|
||||
Transform to be applied.
|
||||
- var_name: speed
|
||||
type: float
|
||||
doc: >
|
||||
Speed to be applied
|
||||
Speed to be applied.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
- param_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
- param_name: speed
|
||||
type: float
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ApplyVelocity
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Sets actor's velocity
|
||||
Command adaptation of **<font color="#7fb800">set_velocity()</font>** in carla.Actor. Sets an actor's velocity.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
|
@ -212,97 +213,101 @@
|
|||
- var_name: velocity
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
The 3D velocity applied to the actor
|
||||
The 3D velocity applied to the actor.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
- param_name: velocity
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ApplyAngularVelocity
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Set the actor's angular velocity
|
||||
Command adaptation of **<font color="#7fb800">set_angular_velocity()</font>** in carla.Actor. Sets an actor's angular velocity.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Actor affected by the command
|
||||
Actor affected by the command.
|
||||
- var_name: angular_velocity
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
The 3D angular velocity that will be applied to the actor
|
||||
The 3D angular velocity that will be applied to the actor.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
- param_name: angular_velocity
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ApplyImpulse
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Adds impulse to the actor
|
||||
Command adaptation of **<font color="#7fb800">add_impulse()</font>** in carla.Actor. Adds impulse to an actor.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Actor affected by the command
|
||||
Actor affected by the command.
|
||||
- var_name: impulse
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Impulse applied to the actor
|
||||
Impulse applied to the actor.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
- param_name: impulse
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: SetSimulatePhysics
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Whether an actor will be affected by physics or not.
|
||||
Command adaptation of **<font color="#7fb800">set_simulate_physics()</font>** in carla.Actor. Determines whether an actor will be affected by physics or not.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Actor affected by the command
|
||||
Actor affected by the command.
|
||||
- var_name: enabled
|
||||
type: bool
|
||||
doc: >
|
||||
If physics will affect the actor
|
||||
If physics should be activated or not.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
- param_name: enabled
|
||||
type: bool
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: SetAutopilot
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Switch on/off vehicle's server-side autopilot
|
||||
Command adaptation of **<font color="#7fb800">set_autopilot()</font>** in carla.Vehicle. Turns on/off the vehicle's server-side autopilot.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor_id
|
||||
|
@ -312,15 +317,16 @@
|
|||
- var_name: enabled
|
||||
type: bool
|
||||
doc: >
|
||||
If the autopilot is enabled or not.
|
||||
If autopilot should be activated or not.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: actor
|
||||
type: carla.Actor or int
|
||||
doc: >
|
||||
Actor or its ID to whom the command will be applied to.
|
||||
- param_name: enabled
|
||||
type: bool
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
|
@ -6,43 +6,43 @@
|
|||
- class_name: VehicleControl
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
VehicleControl is used for controlling the basic movement of a vehicle.
|
||||
Manages the basic movement of a vehicle using typical driving controls.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: throttle
|
||||
type: float
|
||||
doc: >
|
||||
A scalar value to control the vehicle throttle [0.0, 1.0].
|
||||
A scalar value to control the vehicle throttle [0.0, 1.0]. Default is 0.0.
|
||||
# --------------------------------------
|
||||
- var_name: steer
|
||||
type: float
|
||||
doc: >
|
||||
A scalar value to control the vehicle steering [-1.0, 1.0].
|
||||
A scalar value to control the vehicle steering [-1.0, 1.0]. Default is 0.0.
|
||||
# --------------------------------------
|
||||
- var_name: brake
|
||||
type: float
|
||||
doc: >
|
||||
A scalar value to control the vehicle brake [0.0, 1.0].
|
||||
A scalar value to control the vehicle brake [0.0, 1.0]. Default is 0.0.
|
||||
# --------------------------------------
|
||||
- var_name: hand_brake
|
||||
type: bool
|
||||
doc: >
|
||||
If true, hand brake will be used.
|
||||
Determines whether hand brake will be used. Default is <b>False</b>.
|
||||
# --------------------------------------
|
||||
- var_name: reverse
|
||||
type: bool
|
||||
doc: >
|
||||
If true, the vehicle will move reverse.
|
||||
Determines whether the vehicle will move backwards. Default is <b>False</b>.
|
||||
# --------------------------------------
|
||||
- var_name: manual_gear_shift
|
||||
type: bool
|
||||
doc: >
|
||||
If true, the vehicle will be controlled by changing gears manually.
|
||||
Determines whether the vehicle will be controlled by changing gears manually. Default is <b>False</b>.
|
||||
# --------------------------------------
|
||||
- var_name: gear
|
||||
type: int
|
||||
doc: >
|
||||
Controls the gear value of the vehicle.
|
||||
States which gear is the vehicle running on.
|
||||
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
|
@ -69,8 +69,6 @@
|
|||
- param_name: gear
|
||||
type: int
|
||||
default: 0
|
||||
doc: >
|
||||
VehicleControl constructor
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
|
@ -80,32 +78,32 @@
|
|||
params:
|
||||
- param_name: other
|
||||
type: carla.VehicleControl
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: WalkerControl
|
||||
doc: >
|
||||
WalkerControl is used for controlling the basic movement of a walker.
|
||||
This class defines specific directions that can be commanded to a carla.Walker to control it via script. The walker's animations will blend automatically with the parameters defined in this class when applied, though specific skeleton moves can be obtained through class.WalkerBoneControl.
|
||||
|
||||
AI control can be settled for walkers, but the control used to do so is carla.WalkerAIController.
|
||||
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: direction
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Vector that controls the direction of the walker.
|
||||
Vector using global coordinates that will correspond to the direction of the walker.
|
||||
# --------------------------------------
|
||||
- var_name: speed
|
||||
type: float
|
||||
doc: >
|
||||
A scalar value to control the walker speed.
|
||||
A scalar value to control the walker's speed.
|
||||
# --------------------------------------
|
||||
- var_name: jump
|
||||
type: bool
|
||||
doc: >
|
||||
If true, the walker will perform a jump.
|
||||
If <b>True</b>, the walker will perform a jump.
|
||||
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
|
@ -120,35 +118,34 @@
|
|||
- param_name: jump
|
||||
default: False
|
||||
type: bool
|
||||
doc: >
|
||||
WalkerControl constructor
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.WalkerControl
|
||||
doc: >
|
||||
Compares every variable with `other` and returns <b>True</b> if these are all the same.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.WalkerControl
|
||||
doc: >
|
||||
Compares every variable with `other` and returns <b>True</b> if any of these differ.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: WalkerBoneControl
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class used for controlling the skeleton of a walker.
|
||||
See [walker bone control](walker_bone_control.md)
|
||||
This class grants bone specific manipulation for walker. The skeletons of walkers have been unified for clarity and the transform applied to each bone are always relative to its parent. Take a look [here](walker_bone_control.md) to learn more on how to create a walker and define its movement.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: bone_transforms
|
||||
type: list([name,transform])
|
||||
doc: >
|
||||
List of pairs where the first value is the bone name
|
||||
and the second value is the bone transform.
|
||||
List of tuples where the first value is the bone's name and the second value stores the transformation (changes in location and rotation) that will be applied to it.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -156,15 +153,15 @@
|
|||
- param_name: 'list(name,transform)'
|
||||
type: tuple
|
||||
doc: >
|
||||
Intializes an object containing moves to be applied on tick. These are listed with the name of the bone and the transform that will be applied to it.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: GearPhysicsControl
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that provides access to vehicle transmission details.
|
||||
Class that provides access to vehicle transmission details by defining a gear and when to run on it. This will be later used by carla.VehiclePhysicsControl to help simulate physics.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: ratio
|
||||
|
@ -175,12 +172,12 @@
|
|||
- var_name: down_ratio
|
||||
type: float
|
||||
doc: >
|
||||
The level of RPM (in relation to MaxRPM) where the gear autobox initiates shifting down.
|
||||
Quotient between current RPM and MaxRPM where the autonomous gear box should shift down.
|
||||
# --------------------------------------
|
||||
- var_name: up_ratio
|
||||
type: float
|
||||
doc: >
|
||||
The level of RPM (in relation to MaxRPM) where the gear autobox initiates shifting up.
|
||||
Quotient between current RPM and MaxRPM where the autonomous gear box should shift up.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -194,27 +191,23 @@
|
|||
- param_name: up_ratio
|
||||
type: float
|
||||
default: 0.65
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.GearPhysicsControl
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.GearPhysicsControl
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: VehiclePhysicsControl
|
||||
doc: >
|
||||
VehiclePhysicsControl is used for controlling the physics parameters of a vehicle.
|
||||
Summarizes the parameters that will be used to simulate a carla.Vehicle as a physical object. The specific settings for the wheels though are stipulated using carla.WheelPhysicsControl.
|
||||
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
|
@ -236,22 +229,22 @@
|
|||
- var_name: damping_rate_full_throttle
|
||||
type: float
|
||||
doc: >
|
||||
Damping rate when the throttle is maximum.
|
||||
Damping ratio when the throttle is maximum.
|
||||
# --------------------------------------
|
||||
- var_name: damping_rate_zero_throttle_clutch_engaged
|
||||
type: float
|
||||
doc: >
|
||||
Damping rate when the throttle is zero with clutch engaged.
|
||||
Damping ratio when the throttle is zero with clutch engaged.
|
||||
# --------------------------------------
|
||||
- var_name: damping_rate_zero_throttle_clutch_disengaged
|
||||
type: float
|
||||
doc: >
|
||||
Damping rate when the throttle is zero with clutch disengaged.
|
||||
Damping ratio when the throttle is zero with clutch disengaged.
|
||||
# --------------------------------------
|
||||
- var_name: use_gear_autobox
|
||||
type: bool
|
||||
doc: >
|
||||
If true, the vehicle will have an automatic transmission.
|
||||
If <b>True</b>, the vehicle will have an automatic transmission.
|
||||
# --------------------------------------
|
||||
- var_name: gear_switch_time
|
||||
type: float
|
||||
|
@ -261,7 +254,7 @@
|
|||
- var_name: clutch_strength
|
||||
type: float
|
||||
doc: >
|
||||
The clutch strength of the vehicle. Measured in Kgm^2/s.
|
||||
The clutch strength of the vehicle in Kgm^2/s.
|
||||
# --------------------------------------
|
||||
- var_name: final_ratio
|
||||
type: float
|
||||
|
@ -271,12 +264,12 @@
|
|||
- var_name: forward_gears
|
||||
type: list(carla.GearPhysicsControl)
|
||||
doc: >
|
||||
List of GearPhysicsControl objects.
|
||||
List of objects defining the vehicle's gears.
|
||||
# --------------------------------------
|
||||
- var_name: mass
|
||||
type: float
|
||||
doc: >
|
||||
The mass of the vehicle measured in Kg.
|
||||
The mass of the vehicle in Kg.
|
||||
# --------------------------------------
|
||||
- var_name: drag_coefficient
|
||||
type: float
|
||||
|
@ -296,7 +289,7 @@
|
|||
- var_name: wheels
|
||||
type: list(carla.WheelPhysicsControl)
|
||||
doc: >
|
||||
List of carla.WheelPhysicsControl objects. This list should have 4 elements, where index 0 corresponds to the front left wheel, index 1 corresponds to the front right wheel, index 2 corresponds to the back left wheel and index 3 corresponds to the back right wheel. For 2 wheeled vehicles, set the same values for both front and back wheels.
|
||||
List of wheel physics objects. This list should have 4 elements, where index 0 corresponds to the front left wheel, index 1 corresponds to the front right wheel, index 2 corresponds to the back left wheel and index 3 corresponds to the back right wheel. For 2 wheeled vehicles, set the same values for both front and back wheels.
|
||||
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
|
@ -363,12 +356,11 @@
|
|||
type: carla.VehiclePhysicsControl
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: WheelPhysicsControl
|
||||
doc: >
|
||||
WheelPhysicsControl is used for controlling the physics parameters of a vehicle's wheel.
|
||||
Class that defines specific physical parameters for wheel objects that will be part of a carla.VehiclePhysicsControl to simulate vehicle it as a material object.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: tire_friction
|
||||
|
@ -379,32 +371,32 @@
|
|||
- var_name: damping_rate
|
||||
type: float
|
||||
doc: >
|
||||
The damping rate of the wheel.
|
||||
Damping rate of the wheel.
|
||||
# --------------------------------------
|
||||
- var_name: max_steer_angle
|
||||
type: float
|
||||
doc: >
|
||||
The maximum angle in degrees that the wheel can steer.
|
||||
Maximum angle in degrees that the wheel can steer.
|
||||
# --------------------------------------
|
||||
- var_name: radius
|
||||
type: float
|
||||
doc: >
|
||||
The radius of the wheel in centimeters.
|
||||
Radius of the wheel in centimeters.
|
||||
# --------------------------------------
|
||||
- var_name: max_brake_torque
|
||||
type: float
|
||||
doc: >
|
||||
The maximum brake torque in Nm.
|
||||
Maximum brake torque in Nm.
|
||||
# --------------------------------------
|
||||
- var_name: max_handbrake_torque
|
||||
type: float
|
||||
doc: >
|
||||
The maximum handbrake torque in Nm.
|
||||
Maximum handbrake torque in Nm.
|
||||
# --------------------------------------
|
||||
- var_name: position
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
World position of the wheel. Note that it is a read-only parameter.
|
||||
World position of the wheel. This is a read-only parameter.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -430,8 +422,6 @@
|
|||
- param_name: position
|
||||
default: (0.0,0.0,0.0)
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
WheelPhysicsControl constructor
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
|
@ -444,6 +434,5 @@
|
|||
type: carla.WheelPhysicsControl
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
|
@ -1,17 +1,20 @@
|
|||
---
|
||||
- module_name: carla
|
||||
doc: >
|
||||
classes:
|
||||
- class_name: Vector2D
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Vector 2D helper class
|
||||
Helper class to perform 2D operations.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: x
|
||||
type: float
|
||||
doc: >
|
||||
X-axis value.
|
||||
- var_name: 'y'
|
||||
type: float
|
||||
doc: >
|
||||
Y-axis value.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -22,54 +25,75 @@
|
|||
- param_name: y
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __add__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector2D
|
||||
# --------------------------------------
|
||||
- def_name: __mul__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector2D
|
||||
doc: >
|
||||
Defines addition between 2D vectors and applies it to this.
|
||||
# --------------------------------------
|
||||
- def_name: __sub__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector2D
|
||||
doc: >
|
||||
Defines substraction between 2D vectors and applies it to this.
|
||||
# --------------------------------------
|
||||
- def_name: __mul__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector2D
|
||||
doc: >
|
||||
Defines multiplication between 2D vectors and applies it to this.
|
||||
# --------------------------------------
|
||||
- def_name: __truediv__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector2D
|
||||
doc: >
|
||||
Defines division between 2D vectors and applies it to this.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector2D
|
||||
doc: >
|
||||
Returns true if values for every axis are equal.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
- param_name: bool
|
||||
type: carla.Vector2D
|
||||
# --------------------------------------
|
||||
- def_name: __self__
|
||||
doc: >
|
||||
Returns true if the value for any axis is different.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
doc: >
|
||||
Returns the axis values for the vector parsed as string.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: Vector3D
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Vector 3D helper class
|
||||
Helper class to perform 3D operations.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: x
|
||||
type: float
|
||||
doc: >
|
||||
X-axis value.
|
||||
- var_name: 'y'
|
||||
type: float
|
||||
doc: >
|
||||
Y-axis value.
|
||||
- var_name: z
|
||||
type: float
|
||||
doc: >
|
||||
Z-axis value.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -88,49 +112,71 @@
|
|||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector3D
|
||||
# --------------------------------------
|
||||
- def_name: __mul__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Defines addition between 3D vectors and applies it to this.
|
||||
# --------------------------------------
|
||||
- def_name: __sub__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Defines substraction between 3D vectors and applies it to this.
|
||||
# --------------------------------------
|
||||
- def_name: __mul__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Defines multiplication between 3D vectors and applies it to this.
|
||||
# --------------------------------------
|
||||
- def_name: __truediv__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Defines division between 3D vectors and applies it to this.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector3D
|
||||
return: bool
|
||||
doc: >
|
||||
Returns true if values for every axis are equal.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Vector3D
|
||||
return: bool
|
||||
doc: >
|
||||
Returns true if the value for any axis is different.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
doc: >
|
||||
Returns the axis values for the vector parsed as string.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: Location
|
||||
parent: carla.Vector3D
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Represents a location in the world (in meters).
|
||||
Represents a spot in the world.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: x
|
||||
type: float
|
||||
doc: >
|
||||
Distance in meters from origin to spot on X axis.
|
||||
- var_name: 'y'
|
||||
type: float
|
||||
doc: >
|
||||
Distance in meters from origin to spot on Y axis.
|
||||
- var_name: z
|
||||
type: float
|
||||
doc: >
|
||||
Distance in meters from origin to spot on Z axis.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -144,36 +190,47 @@
|
|||
- param_name: z
|
||||
type: float
|
||||
default: 0.0
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Location
|
||||
doc: >
|
||||
The other point to be compared with.
|
||||
doc: >
|
||||
Returns true if both locations are the same point in space.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Location
|
||||
doc: >
|
||||
The other point to be compared with.
|
||||
doc: >
|
||||
Returns true if both locations are different points in space.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
doc: >
|
||||
Parses the axis' values to string.
|
||||
# --------------------------------------
|
||||
- def_name: distance
|
||||
params:
|
||||
- param_name: location
|
||||
type: carla.Location
|
||||
doc: >
|
||||
The Location from where to compute the distance
|
||||
The other point to compute the distance with.
|
||||
return: float
|
||||
doc: >
|
||||
Computes the Euclidean distance in meters from this location to another one
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Location
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Location
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
Returns Euclidean distance in meters from this location to another one.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: Rotation
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that represents a 3D rotation. All rotation angles are stored in degrees.
|
||||
Class that represents a 3D rotation and therefore, an orientation in space.
|
||||
|
||||
|
||||
![UE4_Rotation](https://d26ilriwvtzlb.cloudfront.net/8/83/BRMC_9.jpg)
|
||||
|
@ -183,15 +240,15 @@
|
|||
- var_name: pitch
|
||||
type: float
|
||||
doc: >
|
||||
Rotation about Y-axis.
|
||||
Degrees around the Y-axis.
|
||||
- var_name: yaw
|
||||
type: float
|
||||
doc: >
|
||||
Rotation about Z-axis.
|
||||
Degrees around the Z-axis.
|
||||
- var_name: roll
|
||||
type: float
|
||||
doc: >
|
||||
Rotation about X-axis.
|
||||
Degrees around the X-axis.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -199,46 +256,64 @@
|
|||
- param_name: pitch
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
Y rotation in degrees.
|
||||
- param_name: yaw
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
Z rotation in degrees.
|
||||
- param_name: roll
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
doc: >
|
||||
X rotation in degrees.
|
||||
# --------------------------------------
|
||||
- def_name: get_forward_vector
|
||||
params:
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Computes a forward vector using the current rotation
|
||||
Computes the vector pointing forward according to the orientation of each axis.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Rotation
|
||||
doc: >
|
||||
The other rotation to be compared with.
|
||||
doc: >
|
||||
Returns true if both rotations represent the same orientation of each axis.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Rotation
|
||||
doc: >
|
||||
The other rotation to be compared with.
|
||||
return: bool
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
Returns true if both rotations represent the same orientation of each axis.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
Parses the axis' orientations to string.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: Transform
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines a transformation without scaling.
|
||||
Class that defines a transformation, a combination of location and rotation, without scaling.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: location
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Describes a point in the coordinate system.
|
||||
- var_name: rotation
|
||||
type: carla.Rotation
|
||||
doc: >
|
||||
Describes a rotation for an object according to Unreal Engine's axis system.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -247,42 +322,47 @@
|
|||
type: carla.Location
|
||||
- param_name: rotation
|
||||
type: carla.Rotation
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
Returns true if both location and rotation are equal for this and `other`.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
Returns true if any location and rotation are not equal for this and `other`.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
doc: >
|
||||
Parses both location and rotation to string.
|
||||
# --------------------------------------
|
||||
- def_name: get_forward_vector
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Computes a forward vector using its rotation.
|
||||
# --------------------------------------
|
||||
- def_name: transform
|
||||
params:
|
||||
- param_name: in_point
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Location in the space to which the transformation will be applied
|
||||
doc: >
|
||||
Transform a 3D point using the current transformation
|
||||
# --------------------------------------
|
||||
- def_name: get_forward_vector
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Computes a forward vector using the rotation of the current transformation
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
Location in the space to which the transformation will be applied.
|
||||
doc: >
|
||||
Translates a 3D point from global to local coordinates using the current transformation as frame of reference.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: BoundingBox
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Bounding box helper class.
|
||||
Helper class defining a box location and its dimensions that will later be used by carla.DebugHelper or a carla.Client to draw shapes and detect collisions. Bounding boxes normally act for object colliders. Check out this [recipe](../python_cookbook/#debug-bounding-box-recipe) where the user takes a snapshot of the world and then proceeds to draw bounding boxes for traffic lights.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: location
|
||||
|
@ -292,18 +372,21 @@
|
|||
- var_name: extent
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
It contains the vector from the center of the bounding box to one of the vertex of the box.
|
||||
|
||||
So, if you want to know the _X bounding box size_, you can just do `extent.x * 2`
|
||||
Vector from the center of the box to one vertex. The value in each axis equals half the size of the box for that axis.
|
||||
|
||||
`extent.x * 2` would return the size of the box in the X-axis.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: location
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Point to center the box.
|
||||
- param_name: extent
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
doc: >
|
||||
Vector containing half the size of the box for every axis.
|
||||
# --------------------------------------
|
||||
- def_name: contains
|
||||
return: bool
|
||||
|
@ -335,25 +418,31 @@
|
|||
Returns a list containing the locations of this object's vertices in world space.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.BoundingBox
|
||||
doc: >
|
||||
Returns true if both location and extent are equal for this and `other`.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.BoundingBox
|
||||
doc: >
|
||||
Returns true if either location or extent are different for this and `other`.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
doc: >
|
||||
Parses the location and extent of the bounding box to string.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: GeoLocation
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that contains geolocation simulated data
|
||||
Class that contains geographical coordinates simulated data. The carla.Map can convert simulation locations by using the <b><georeference></b> tag in the OpenDRIVE file.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: latitude
|
||||
|
|
|
@ -6,14 +6,11 @@
|
|||
- class_name: LaneType
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines the possible lane types accepted by OpenDRIVE 1.4. This standards define the road information. For instance in this [recipe](../python_cookbook/#lanes-recipe) the user creates a carla.Waypoint for the current location of a vehicle and uses it to get the current and adjacent lane types.
|
||||
Class that defines the possible lane types accepted by OpenDRIVE 1.4. This standards define the road information. For instance in this [recipe](../python_cookbook/#lanes-recipe) the user creates a carla.Waypoint for the current location of a vehicle and uses it to get the current and adjacent lane types.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: NONE
|
||||
doc: >
|
||||
- var_name: Any
|
||||
doc: >
|
||||
Every type except for NONE.
|
||||
doc: >
|
||||
- var_name: Bidirectional
|
||||
doc: >
|
||||
- var_name: Biking
|
||||
|
@ -54,11 +51,14 @@
|
|||
doc: >
|
||||
- var_name: Tram
|
||||
doc: >
|
||||
- var_name: Any
|
||||
doc: >
|
||||
Every type except for NONE.
|
||||
|
||||
- class_name: LaneChange
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines the permission to turn either left, right, both or none (meaning only going straight is allowed). This information is stored for every carla.Waypoint according to the OpenDRIVE file. In this [recipe](../python_cookbook/#lanes-recipe) the user creates a waypoint for a current vehicle position and learns which turns are permitted.
|
||||
Class that defines the permission to turn either left, right, both or none (meaning only going straight is allowed). This information is stored for every carla.Waypoint according to the OpenDRIVE file. In this [recipe](../python_cookbook/#lanes-recipe) the user creates a waypoint for a current vehicle position and learns which turns are permitted.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: NONE
|
||||
|
@ -82,7 +82,7 @@
|
|||
instance_variables:
|
||||
- var_name: Standard
|
||||
doc: >
|
||||
White by default.
|
||||
White by default.
|
||||
- var_name: Blue
|
||||
doc: >
|
||||
- var_name: Green
|
||||
|
@ -99,7 +99,9 @@
|
|||
- class_name: LaneMarkingType
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines the lane marking types accepted by OpenDRIVE 1.4. Take a look at this [recipe](../python_cookbook/#lanes-recipe) where the user creates a carla.Waypoint for a vehicle location and retrieves from it the information about adjacent lane markings.
|
||||
Class that defines the lane marking types accepted by OpenDRIVE 1.4. Take a look at this [recipe](../python_cookbook/#lanes-recipe) where the user creates a carla.Waypoint for a vehicle location and retrieves from it the information about adjacent lane markings.
|
||||
|
||||
__Note on double types:__ Lane markings are defined under the OpenDRIVE standard that determines whereas a line will be considered "BrokenSolid" or "SolidBroken". For each road there is a center lane marking, defined from left to right regarding the lane's directions. The rest of the lane markings are defined in order from the center lane to the closest outside of the road.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: NONE
|
||||
|
@ -109,11 +111,9 @@
|
|||
- var_name: Broken
|
||||
doc: >
|
||||
- var_name: BrokenBroken
|
||||
doc: >
|
||||
From inside to outside except for center lane which is from left to right.
|
||||
doc: >
|
||||
- var_name: BrokenSolid
|
||||
doc: >
|
||||
From inside to outside except for center lane which is from left to right.
|
||||
- var_name: Curb
|
||||
doc: >
|
||||
- var_name: Grass
|
||||
|
@ -122,38 +122,36 @@
|
|||
doc: >
|
||||
- var_name: SolidBroken
|
||||
doc: >
|
||||
From inside to outside except for center lane which is from left to right.
|
||||
- var_name: SolidSolid
|
||||
doc: >
|
||||
For double solid line.
|
||||
- var_name: Other
|
||||
doc: >
|
||||
|
||||
- class_name: Map
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class containing the road information and waypoint managing. Data is retrieved from an OpenDRIVE file that describes the road. A query system is defined which works hand in hand with carla.Waypoint to translate geometrical information from the .xodr to natural world points. CARLA is currently working with [OpenDRIVE 1.4 standard](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf).
|
||||
Class containing the road information and waypoint managing. Data is retrieved from an OpenDRIVE file that describes the road. A query system is defined which works hand in hand with carla.Waypoint to translate geometrical information from the .xodr to natural world points. CARLA is currently working with [OpenDRIVE 1.4 standard](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf).
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: name
|
||||
type: str
|
||||
doc: >
|
||||
The name of the map. It corresponds to the .umap from Unreal Engine that is loaded from a CARLA server, which then references to the .xodr road description.
|
||||
The name of the map. It corresponds to the .umap from Unreal Engine that is loaded from a CARLA server, which then references to the .xodr road description.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: name
|
||||
type: str
|
||||
doc: >
|
||||
Name of the current map.
|
||||
doc: >
|
||||
Name of the current map.
|
||||
- param_name: xodr_content
|
||||
type: str
|
||||
doc: >
|
||||
.xodr content in string format.
|
||||
return: list(carla.Transform)
|
||||
doc: >
|
||||
Constructor for this class. Though a map is automatically generated when initializing the world, using this method in no-rendering mode facilitates working with an .xodr without any CARLA server running.
|
||||
Constructor for this class. Though a map is automatically generated when initializing the world, using this method in no-rendering mode facilitates working with an .xodr without any CARLA server running.
|
||||
# --------------------------------------
|
||||
- def_name: generate_waypoints
|
||||
params:
|
||||
|
@ -163,12 +161,12 @@
|
|||
Approximate distance between waypoints.
|
||||
return: list(carla.Waypoint)
|
||||
doc: >
|
||||
Returns a list of waypoints with a certain distance between them for every lane and centered inside of it. Waypoints are not listed in any particular order. Remember that waypoints closer than 2cm within the same road, section and lane will have the same identificator.
|
||||
Returns a list of waypoints with a certain distance between them for every lane and centered inside of it. Waypoints are not listed in any particular order. Remember that waypoints closer than 2cm within the same road, section and lane will have the same identificator.
|
||||
# --------------------------------------
|
||||
- def_name: get_spawn_points
|
||||
return: list(carla.Transform)
|
||||
doc: >
|
||||
Returns a list of recommendations made by creators of the map to be used spawning points for vehicles. The list includes carla.Tranform objects with certain location and orientation. Said locations are slightly on-air and vehicles fall for a bit before starting their way.
|
||||
Returns a list of recommendations made by the creators of the map to be used as spawning points for the vehicles. The list includes carla.Transform objects with certain location and orientation. Said locations are slightly on-air in order to avoid Z-collisions, so vehicles fall for a bit before starting their way.
|
||||
# --------------------------------------
|
||||
- def_name: get_topology
|
||||
doc: >
|
||||
|
@ -177,22 +175,22 @@
|
|||
# --------------------------------------
|
||||
- def_name: get_waypoint
|
||||
doc: >
|
||||
Returns a waypoint that can be located in an exact location or translated to the center of the nearest lane. Said lane type can be defined using flags such as `LaneType.Driving & LaneType.Shoulder`.
|
||||
The method will return <b>None</b> if the waypoint is not found, which may happen only when trying to retrieve a waypoint for an exact location. That eases checking if a point is inside a certain road, as otherwise, it will return the corresponding waypoint.
|
||||
Returns a waypoint that can be located in an exact location or translated to the center of the nearest lane. Said lane type can be defined using flags such as `LaneType.Driving & LaneType.Shoulder`.
|
||||
The method will return <b>None</b> if the waypoint is not found, which may happen only when trying to retrieve a waypoint for an exact location. That eases checking if a point is inside a certain road, as otherwise, it will return the corresponding waypoint.
|
||||
params:
|
||||
- param_name: location
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Location used as reference for the carla.Waypoint.
|
||||
doc: >
|
||||
Location used as reference for the carla.Waypoint.
|
||||
- param_name: project_to_road
|
||||
type: bool
|
||||
default: "True"
|
||||
doc: >
|
||||
doc: >
|
||||
If **True**, the waypoint will be at the center of the closest lane. This is the default setting. If **False**, the waypoint will be exactly in `location`. <b>None</b> means said location does not belong to a road.
|
||||
- param_name: lane_type
|
||||
type: carla.LaneType
|
||||
default: carla.LaneType.Driving
|
||||
doc: >
|
||||
doc: >
|
||||
Limits the search for nearest lane to one or various lane types that can be flagged.
|
||||
return: carla.Waypoint
|
||||
# --------------------------------------
|
||||
|
@ -214,26 +212,7 @@
|
|||
Specify the length from the road start
|
||||
return: carla.Waypoint
|
||||
# --------------------------------------
|
||||
- def_name: get_topology
|
||||
doc: >
|
||||
It provides a minimal graph of the topology of the current OpenDRIVE file.
|
||||
It is constituted by a list of pairs of waypoints, where the first waypoint is the origin and the second
|
||||
one is the destination. It can be loaded into [NetworkX](https://networkx.github.io/). A valid output could be:
|
||||
`[ (w0, w1), (w0, w2), (w1, w3), (w2, w3), (w0, w4) ]`
|
||||
return: list(tuple(carla.Waypoint, carla.Waypoint))
|
||||
# --------------------------------------
|
||||
- def_name: generate_waypoints
|
||||
params:
|
||||
- param_name: distance
|
||||
type: float
|
||||
doc: >
|
||||
Approximate distance between the waypoints
|
||||
return: list(carla.Waypoint)
|
||||
doc: >
|
||||
Returns a list of waypoints positioned on the center of the lanes
|
||||
all over the map with an approximate distance between them.
|
||||
# --------------------------------------
|
||||
- def_name: transform_to_geolocation
|
||||
- def_name: save_to_disk
|
||||
params:
|
||||
- param_name: path
|
||||
doc: >
|
||||
|
@ -243,7 +222,7 @@
|
|||
# --------------------------------------
|
||||
- def_name: to_opendrive
|
||||
doc: >
|
||||
Returns the .xodr OpenDRIVe file of the current map as string.
|
||||
Returns the .xodr OpenDRIVe file of the current map as string.
|
||||
return: str
|
||||
# --------------------------------------
|
||||
- def_name: transform_to_geolocation
|
||||
|
@ -260,17 +239,17 @@
|
|||
- class_name: LaneMarking
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that gathers all the information regarding a lane marking according to [OpenDRIVE 1.4 standard](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf) standard.
|
||||
Class that gathers all the information regarding a lane marking according to [OpenDRIVE 1.4 standard](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf) standard.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: color
|
||||
type: carla.LaneMarkingColor
|
||||
doc: >
|
||||
Actual color of the marking.
|
||||
Actual color of the marking.
|
||||
- var_name: lane_change
|
||||
type: carla.LaneChange
|
||||
doc: >
|
||||
Permissions for said lane marking to be crossed.
|
||||
Permissions for said lane marking to be crossed.
|
||||
- var_name: type
|
||||
type: carla.LaneMarkingType
|
||||
doc: >
|
||||
|
@ -284,21 +263,21 @@
|
|||
- class_name: Waypoint
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Waypoints in CARLA are described as 3D directed points. They store a certain carla.Transform which locates the waypoint in a road and orientates it according to the lane. They also store the road information belonging to said point regarding its lane and lane markings. All of this information is retrieved as provided by the OpenDRIVE file.
|
||||
Waypoints in CARLA are described as 3D directed points. They store a certain carla.Transform which locates the waypoint in a road and orientates it according to the lane. They also store the road information belonging to said point regarding its lane and lane markings. All of this information is retrieved as provided by the OpenDRIVE file.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: id
|
||||
type: int
|
||||
doc: >
|
||||
The identificator is generated using a hash combination of the <b>road</b>, <b>section</b>, <b>lane</b> and <b>s</b> values that correspond to said point in the OpenDRIVE geometry. The <b>s</b> precision is set to 2 centimeters, so 2 waypoints closer than 2 centimeters in the same road, section and lane, will have the same identificator.
|
||||
The identificator is generated using a hash combination of the <b>road</b>, <b>section</b>, <b>lane</b> and <b>s</b> values that correspond to said point in the OpenDRIVE geometry. The <b>s</b> precision is set to 2 centimeters, so 2 waypoints closer than 2 centimeters in the same road, section and lane, will have the same identificator.
|
||||
- var_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
Position and orientation of the waypoint according to the current lane information. This data is computed the first time it is accessed. It is not created right away in order to ease computing costs when lots of waypoints are created but their specific transform is not needed.
|
||||
Position and orientation of the waypoint according to the current lane information. This data is computed the first time it is accessed. It is not created right away in order to ease computing costs when lots of waypoints are created but their specific transform is not needed.
|
||||
- var_name: road_id
|
||||
type: int
|
||||
doc: >
|
||||
OpenDRIVE road's id.
|
||||
OpenDRIVE road's id.
|
||||
- var_name: section_id
|
||||
type: int
|
||||
doc: >
|
||||
|
@ -314,7 +293,7 @@
|
|||
- var_name: is_junction
|
||||
type: bool
|
||||
doc: >
|
||||
<b>True</b> if the current Waypoint is on a junction as defined by OpenDRIVE.
|
||||
<b>True</b> if the current Waypoint is on a junction as defined by OpenDRIVE.
|
||||
- var_name: lane_width
|
||||
type: float
|
||||
doc: >
|
||||
|
@ -340,16 +319,16 @@
|
|||
- def_name: get_left_lane
|
||||
return: carla.Waypoint
|
||||
doc: >
|
||||
Generates a Waypoint at the center of the left lane based on the direction of the current Waypoint, regardless if the lane change is allowed in this location.
|
||||
Generates a Waypoint at the center of the left lane based on the direction of the current Waypoint, taking into account if the lane change is allowed in this location.
|
||||
|
||||
Can return <b>None</b> if the lane does not exist
|
||||
Will return <b>None</b> if the lane does not exist
|
||||
# --------------------------------------
|
||||
- def_name: get_right_lane
|
||||
return: carla.Waypoint
|
||||
doc: >
|
||||
Generates a waypoint at the center of the right lane based on the direction of the current waypoint, regardless if the lane change is allowed in this location.
|
||||
Generates a waypoint at the center of the right lane based on the direction of the current waypoint, taking into account if the lane change is allowed in this location.
|
||||
|
||||
Can return <b>None</b> if the lane does not exist.
|
||||
Will return <b>None</b> if the lane does not exist.
|
||||
# --------------------------------------
|
||||
- def_name: next
|
||||
params:
|
||||
|
@ -359,9 +338,9 @@
|
|||
The approximate distance where to get the next waypoints.
|
||||
return: list(carla.Waypoint)
|
||||
doc: >
|
||||
Returns a list of waypoints at a certain approximate `distance` from the current one. It takes into account the road and its possible deviations without performing any lane change and returns one waypoint per option.
|
||||
Returns a list of waypoints at a certain approximate `distance` from the current one. It takes into account the road and its possible deviations without performing any lane change and returns one waypoint per option.
|
||||
|
||||
The list may be empty if the road ends before the specified distance, for instance, a lane ending with the only option of incorporating to another road.
|
||||
The list may be empty if the lane is not connected to any other at the specified distance.
|
||||
# --------------------------------------
|
||||
- def_name: next_until_lane_end
|
||||
params:
|
||||
|
@ -381,9 +360,9 @@
|
|||
The approximate distance where to get the previous waypoints.
|
||||
return: list(carla.Waypoint)
|
||||
doc: >
|
||||
This method does not return the waypoint previously visited by an actor, but a list of waypoints at an approximate `distance` but in the opposite direction of the lane. Similarly to **<font color="#7fb800">next()</font>**, it takes into account the road and its possible deviations without performing any lane change and returns one waypoint per option.
|
||||
This method does not return the waypoint previously visited by an actor, but a list of waypoints at an approximate `distance` but in the opposite direction of the lane. Similarly to **<font color="#7fb800">next()</font>**, it takes into account the road and its possible deviations without performing any lane change and returns one waypoint per option.
|
||||
|
||||
The list may be empty if the road ends before the specified distance, for instance, a lane ending with the only option of incorporating to another road.
|
||||
The list may be empty if the lane is not connected to any other at the specified distance.
|
||||
# --------------------------------------
|
||||
- def_name: previous_until_lane_start
|
||||
params:
|
||||
|
@ -422,6 +401,6 @@
|
|||
Type of lanes to get the waypoints.
|
||||
return: list(tuple(carla.Waypoint))
|
||||
doc: >
|
||||
Returns a list of pairs of waypoints. Every tuple on the list contains first an initial and then a final waypoint within the intersection boundaries that describe the beginning and the end of said lane along the junction. Lanes follow their OpenDRIVE definitions so there may be many different tuples with the same starting waypoint due to possible deviations, as this are considered different lanes.
|
||||
Returns a list of pairs of waypoints. Every tuple on the list contains first an initial and then a final waypoint within the intersection boundaries that describe the beginning and the end of said lane along the junction. Lanes follow their OpenDRIVE definitions so there may be many different tuples with the same starting waypoint due to possible deviations, as this are considered different lanes.
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
|
@ -1,19 +1,33 @@
|
|||
---
|
||||
- module_name: carla
|
||||
doc: >
|
||||
# - CLASSES ------------------------------
|
||||
classes:
|
||||
- class_name: Sensor
|
||||
parent: carla.Actor
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
A sensor actor.
|
||||
Sensors compound a specific family of actors quite diverse and unique. They are normally spawned as attachment/sons of a vehicle (take a look at carla.World to learn about actor spawning). Sensors are thoroughly designed to retrieve different types of data that they are listening to. The data they receive is shaped as different subclasses inherited from carla.SensorData (depending on the sensor).
|
||||
|
||||
Most sensors can be divided in two groups: those receiving data on every tick (cameras, point clouds and some specific sensors) and those who only receive under certain circumstances (trigger detectors). CARLA provides a specific set of sensors and their blueprint can be found in carla.BlueprintLibrary. All the information on their preferences and settlement can be found [here](/cameras_and_sensors/), but the list of those available in CARLA so far goes as follow:
|
||||
<b>Receive data on every tick:</b>
|
||||
- Gnss sensor.
|
||||
- IMU sensor.
|
||||
- Radar.
|
||||
- [Depth camera](/cameras_and_sensors/#sensorcameradepth).
|
||||
- [Lidar raycast](/cameras_and_sensors/#sensorlidarray_cast).
|
||||
- [RGB camera](/cameras_and_sensors/#sensorcamerargb).
|
||||
- [Semantic Segmentation camera](/cameras_and_sensors/#sensorcamerasemantic_segmentation).
|
||||
<b>Only receive data when triggered:</b>
|
||||
- [Collision detector](/cameras_and_sensors/#sensorothercollision).
|
||||
- [Lane invasion detector](/cameras_and_sensors/#sensorotherlane_invasion).
|
||||
- [Obstacle detector](/cameras_and_sensors/#sensorotherobstacle).
|
||||
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: is_listening
|
||||
type: boolean
|
||||
doc: >
|
||||
Is true if the sensor is listening for data
|
||||
When <b>True</b> the sensor will be waiting for data.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: listen
|
||||
|
@ -21,17 +35,14 @@
|
|||
- param_name: callback
|
||||
type: function
|
||||
doc: >
|
||||
Register a callback to be executed each time a new measurement is
|
||||
received. The callback must accept a single argument containing the
|
||||
sensor data; the type of this object varies depending on the type of
|
||||
sensor, but they all derive from carla.SensorData.
|
||||
The called function with one argument containing the sensor data.
|
||||
doc: >
|
||||
The function the sensor will be calling to every time a new measurement is received. This function needs for an argument containing an object type carla.SensorData to work with.
|
||||
# --------------------------------------
|
||||
- def_name: stop
|
||||
doc: >
|
||||
Stops listening for data
|
||||
Commands the sensor to stop listening for data.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
---
|
||||
- module_name: carla
|
||||
doc: >
|
||||
# - CLASSES ------------------------------
|
||||
classes:
|
||||
- class_name: SensorData
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Base class for all the objects containing data generated by a sensor.
|
||||
Base class for all the objects containing data generated by a carla.Sensor. This objects should be the argument of the function said sensor is listening to, in order to work with them. Each of these sensors needs for a specific type of sensor data. The relation between available sensors and their corresponding data goes like:
|
||||
- Cameras (RGB, depth and semantic segmentation): carla.Image.
|
||||
- Collision detector: carla.CollisionEvent.
|
||||
- Gnss detector: carla.GnssMeasurement.
|
||||
- IMU detector: carla.IMUMeasurement.
|
||||
- Lane invasion detector: carla.LaneInvasionEvent.
|
||||
- Lidar raycast: carla.LidarMeasurement.
|
||||
- Obstacle detector: carla.ObstacleDetectionEvent.
|
||||
- Radar detector: carla.RadarMeasurement.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: frame
|
||||
|
@ -26,40 +33,43 @@
|
|||
- class_name: ColorConverter
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines the color converter options. Check out this [`recipe`](../python_cookbook/#converted-image-recipe)!
|
||||
Class that defines conversion patterns that can be applied to a carla.Image in order to show information provided by carla.Sensor. Depth conversions cause a loss of accuracy, as sensors detect depth as <b>float</b> that is then converted to a grayscale value between 0 and 255. Take a look a this [recipe](../python_cookbook/#converted-image-recipe) to see an example of how to create and save image data for <b>sensor.camera.semantic_segmentation</b>.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: Raw
|
||||
doc: >
|
||||
- var_name: Depth
|
||||
doc: >
|
||||
- var_name: LogarithmicDepth
|
||||
doc: >
|
||||
- var_name: CityScapesPalette
|
||||
doc: >
|
||||
Converts the image to a segmentated map using tags provided by the blueprint library. Used by <b>sensor.camera.semantic_segmentation</b>.
|
||||
- var_name: Depth
|
||||
doc: >
|
||||
Converts the image to a linear depth map. Used by <b>sensor.camera.depth</b>.
|
||||
- var_name: LogarithmicDepth
|
||||
doc: >
|
||||
Converts the image to a depth map using a logarithmic scale, leading to better precision for small distances at the expense of losing it when further away.
|
||||
- var_name: Raw
|
||||
doc: >
|
||||
No changes applied to the image.
|
||||
|
||||
- class_name: Image
|
||||
parent: carla.SensorData
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines an image of 32-bit BGRA colors.
|
||||
Class that defines an image of 32-bit BGRA colors that will be used as initial data retrieved by camera sensors. There are different camera sensors (currently three, RGB, depth and semantic segmentation) and each of these makes different use for the images. Learn more about them [here](/cameras_and_sensors/).
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: width
|
||||
type: int
|
||||
doc: >
|
||||
Image width in pixels.
|
||||
- var_name: height
|
||||
type: int
|
||||
doc: >
|
||||
Image height in pixels
|
||||
- var_name: fov
|
||||
type: float
|
||||
doc: >
|
||||
Horizontal field of view of the image in degrees.
|
||||
- var_name: height
|
||||
type: int
|
||||
doc: >
|
||||
Image height in pixels.
|
||||
- var_name: width
|
||||
type: int
|
||||
doc: >
|
||||
Image width in pixels.
|
||||
- var_name: raw_data
|
||||
type: bytes
|
||||
doc: >
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: convert
|
||||
|
@ -67,31 +77,30 @@
|
|||
- param_name: color_converter
|
||||
type: carla.ColorConverter
|
||||
doc: >
|
||||
Convert the image with the applied conversion.
|
||||
Converts the image following the `color_converter` pattern.
|
||||
# --------------------------------------
|
||||
- def_name: save_to_disk
|
||||
params:
|
||||
- param_name: path
|
||||
type: str
|
||||
doc: >
|
||||
Path where it will be saved
|
||||
Path that will contain the image.
|
||||
- param_name: color_converter
|
||||
type: carla.ColorConverter
|
||||
default: Raw
|
||||
doc: >
|
||||
Default <b>Raw</b> will make no changes.
|
||||
doc: >
|
||||
Save the image to disk.
|
||||
Saves the image to disk using a converter pattern stated as `color_converter`. The default conversion pattern is <b>Raw</b> that will make no changes to the image.
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __iter__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __getitem__
|
||||
params:
|
||||
- param_name: pos
|
||||
type: int
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __setitem__
|
||||
params:
|
||||
|
@ -99,31 +108,29 @@
|
|||
type: int
|
||||
- param_name: color
|
||||
type: carla.Color
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: LidarMeasurement
|
||||
parent: carla.SensorData
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Lidar sensor measurement data.
|
||||
Class that defines the lidar data retrieved by a <b>sensor.lidar.ray_cast</b>. This essentially simulates a rotating lidar using ray-casting. Learn more about this [here](/cameras_and_sensors/#sensorlidarray_cast).
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: horizontal_angle
|
||||
type: float
|
||||
doc: >
|
||||
Horizontal angle that the Lidar has rotated at the time of the measurement (in radians)
|
||||
- var_name: channels
|
||||
type: int
|
||||
doc: >
|
||||
Number of lasers
|
||||
Number of lasers shot.
|
||||
- var_name: horizontal_angle
|
||||
type: float
|
||||
doc: >
|
||||
Horizontal angle the Lidar is rotated at the time of the measurement (in radians).
|
||||
- var_name: raw_data
|
||||
type: bytes
|
||||
doc: >
|
||||
List of 3D points
|
||||
List of 3D points received as data.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: get_point_count
|
||||
|
@ -131,29 +138,23 @@
|
|||
- param_name: channel
|
||||
type: int
|
||||
doc: >
|
||||
Retrieve the number of points that are generated by this channel.
|
||||
note: >
|
||||
Points are sorted by channel, so this method allows to identify the channel
|
||||
that generated each point.
|
||||
Retrieves the number of points sorted by channel that are generated by this measure. Sorting by channel allows to identify the original channel for every point.
|
||||
# --------------------------------------
|
||||
- def_name: save_to_disk
|
||||
params:
|
||||
- param_name: path
|
||||
type: str
|
||||
doc: >
|
||||
Save point cloud to disk
|
||||
Saves the point cloud to disk as a <b>.ply</b> file describing data from 3D scanners. The files generated are ready to be used within [MeshLab](http://www.meshlab.net/), an open source system for processing said files. Just take into account that axis may differ from Unreal Engine and so, need to be reallocated.
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __iter__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __getitem__
|
||||
params:
|
||||
- param_name: pos
|
||||
type: int
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __setitem__
|
||||
params:
|
||||
|
@ -161,85 +162,85 @@
|
|||
type: int
|
||||
- param_name: location
|
||||
type: carla.Location
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: CollisionEvent
|
||||
parent: carla.SensorData
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines a registered collision.
|
||||
Class that defines a collision data for <b>sensor.other.collision</b>. The sensor creates one of this for every collision detected which may be many for one simulation step. Learn more about this [here](/cameras_and_sensors/#sensorothercollision).
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor
|
||||
type: carla.Actor
|
||||
doc: >
|
||||
Get "self" actor. Actor that measured the collision.
|
||||
The actor the sensor is attached to, the one that measured the collision.
|
||||
- var_name: other_actor
|
||||
type: carla.Actor
|
||||
doc: >
|
||||
Get the actor to which we collided.
|
||||
The second actor involved in the collision.
|
||||
- var_name: normal_impulse
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Normal impulse result of the collision.
|
||||
Normal impulse resulting of the collision.
|
||||
|
||||
- class_name: ObstacleDetectionEvent
|
||||
parent: carla.SensorData
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Obstacle detection sensor data
|
||||
Class that defines the obstacle data for <b>sensor.other.obstacle</b>. Learn more about this [here](/cameras_and_sensors/#sensorotherobstacle).
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor
|
||||
type: carla.Actor
|
||||
doc: >
|
||||
Get "self" actor. Actor that measured the collision.
|
||||
The actor the sensor is attached to.
|
||||
- var_name: other_actor
|
||||
type: carla.Actor
|
||||
doc: >
|
||||
Get the actor to which we collided.
|
||||
The actor or object considered to be an obstacle.
|
||||
- var_name: distance
|
||||
type: float
|
||||
doc: >
|
||||
Get obstacle distance.
|
||||
Distance between `actor` and `other`.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: LaneInvasionEvent
|
||||
parent: carla.SensorData
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Lane invasion sensor data.
|
||||
Class that defines lanes invasion for <b>sensor.other.lane_invasion</b>. It works only client-side and is dependant on OpenDRIVE to provide reliable information. The sensor creates one of this every time there is a lane invasion, which may be more than once per simulation step. Learn more about this [here](/cameras_and_sensors/#sensorotherlane_invasion).
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: actor
|
||||
type: carla.Actor
|
||||
doc: >
|
||||
Get "self" actor. Actor that invaded another lane.
|
||||
Gets the actor the sensor is attached to, the one that invaded another lane.
|
||||
- var_name: crossed_lane_markings
|
||||
type: list(carla.LaneMarking)
|
||||
doc: >
|
||||
List of lane markings that have been crossed.
|
||||
List of lane markings that have been crossed and detected by the sensor.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: GnssMeasurement
|
||||
parent: carla.SensorData
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Gnss sensor data
|
||||
Class that defines the Gnss data registered by a <b>sensor.other.gnss</b>. It essentially reports its position with the position of the sensor and an OpenDRIVE geo-reference.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: altitude
|
||||
type: float
|
||||
doc: >
|
||||
Height regarding ground level.
|
||||
- var_name: latitude
|
||||
type: float
|
||||
doc: >
|
||||
|
@ -248,69 +249,60 @@
|
|||
type: float
|
||||
doc: >
|
||||
West/East value of a point on the map.
|
||||
- var_name: altitude
|
||||
type: float
|
||||
doc: >
|
||||
Height regarding ground level.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: IMUMeasurement
|
||||
parent: carla.SensorData
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
IMU sensor data regarding the sensor World's transformation
|
||||
Class that defines the data registered by a <b>sensor.other.imu</b>, regarding the sensor's transformation according to the current carla.World. It essentially acts as accelerometer, gyroscope and compass.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: accelerometer
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Measures linear acceleration in `m/s^2`.
|
||||
- var_name: gyroscope
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Measures angular velocity in `rad/sec`.
|
||||
Linear acceleration in m/s^2.
|
||||
- var_name: compass
|
||||
type: float
|
||||
doc: >
|
||||
Orientation with respect to the North (`(0.0, -1.0, 0.0)` in Unreal) in radians.
|
||||
Orientation with regard to the North ((0.0, -1.0, 0.0) in Unreal Engine) in radians.
|
||||
- var_name: gyroscope
|
||||
type: carla.Vector3D
|
||||
doc: >
|
||||
Angular velocity in rad/sec.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: RadarMeasurement
|
||||
parent: carla.SensorData
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Measurement produced by a Radar. Consists of an array of carla.RadarDetection.
|
||||
Class that defines and gathers the measures registered by a <b>sensor.other.radar</b>, representing a wall of points in front of the sensor with a distance, angle and velocity in relation to it. The data consists of a carla.RadarDetection array.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: raw_data
|
||||
type: bytes
|
||||
doc: >
|
||||
List of carla.RadarDetection.
|
||||
The complete information of the carla.RadarDetection the radar has registered.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: get_detection_count
|
||||
doc: >
|
||||
Retrieve the number of carla.RadarDetection that are generated.
|
||||
Retrieves the number of entries generated, same as **<font color="#7fb800">\__str__()</font>**.
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __iter__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __getitem__
|
||||
params:
|
||||
- param_name: pos
|
||||
type: int
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __setitem__
|
||||
params:
|
||||
|
@ -318,40 +310,37 @@
|
|||
type: int
|
||||
- param_name: detection
|
||||
type: carla.RadarDetection
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: RadarDetection
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Data contained by a carla.RadarMeasurement. Represents an object detection produced by the Radar sensor.
|
||||
Data contained inside a carla.RadarMeasurement. Each of these represents one of the points in the cloud that a <b>sensor.other.radar</b> registers and contains the distance, angle and velocity in relation to the radar.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: velocity
|
||||
- var_name: altitude
|
||||
type: float
|
||||
doc: >
|
||||
The velocity of the detected object towards the sensor in meters per second.
|
||||
Altitude angle of the detection in radians.
|
||||
# --------------------------------------
|
||||
- var_name: azimuth
|
||||
type: float
|
||||
doc: >
|
||||
Azimuth angle of the detection in radians
|
||||
# --------------------------------------
|
||||
- var_name: altitude
|
||||
type: float
|
||||
doc: >
|
||||
Altitude angle of the detection in radians
|
||||
Azimuth angle of the detection in radians.
|
||||
# --------------------------------------
|
||||
- var_name: depth
|
||||
type: float
|
||||
doc: >
|
||||
Distance in meters from the sensor to the detection position.
|
||||
# --------------------------------------
|
||||
- var_name: velocity
|
||||
type: float
|
||||
doc: >
|
||||
The velocity of the detected object towards the sensor in m/s.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
|
@ -2,100 +2,100 @@
|
|||
- module_name: carla
|
||||
doc: >
|
||||
# - CLASSES ------------------------------
|
||||
|
||||
classes:
|
||||
- class_name: WorldSnapshot
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that represents the state of every actor
|
||||
in the simulation at a single frame
|
||||
This snapshot comprises all the information for every actor on scene at a certain moment of time. It creates and gives acces to a data structure containing a series of carla.ActorSnapshot. The client recieves a new snapshot on every tick that cannot be stored.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: id
|
||||
type: int
|
||||
doc: >
|
||||
The WorldSnapshot's identifier
|
||||
A value unique for every snapshot to differenciate them.
|
||||
- var_name: frame
|
||||
type: int
|
||||
doc: >
|
||||
Frame number
|
||||
Simulation frame in which the snapshot was taken.
|
||||
- var_name: timestamp
|
||||
type: carla.Timestamp
|
||||
doc: >
|
||||
Timestamp simulated data
|
||||
Precise moment in time when snapshot was taken. This class works in seconds as given by the operative system.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: has_actor
|
||||
- def_name: __eq__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: actor_id
|
||||
type: int
|
||||
- param_name: other
|
||||
type: carla.WorldSnapshot
|
||||
doc: >
|
||||
Check if an actor is present in this snapshot.
|
||||
Returns <b>True</b> if both **<font color="#f8805a">timestamp</font>** are the same.
|
||||
# --------------------------------------
|
||||
- def_name: find
|
||||
return:
|
||||
params:
|
||||
- param_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Find an ActorSnapshot by id, return None if the actor is not found.
|
||||
- def_name: __iter__
|
||||
doc: >
|
||||
Method that enables iteration for this class using **<font color="#f8805a">timestamp</font>** as reference value.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.WorldSnapshot
|
||||
doc: >
|
||||
Returns <b>True</b> if both **<font color="#f8805a">timestamp</font>** are different.
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
return: int
|
||||
doc: >
|
||||
Return number of carla.ActorSnapshot present in this carla.WorldSnapshot.
|
||||
Returns the amount of carla.ActorSnapshot present in this snapshot.
|
||||
# --------------------------------------
|
||||
- def_name: __iter__
|
||||
doc: >
|
||||
- def_name: find
|
||||
return: carla.ActorSnapshot
|
||||
params:
|
||||
- param_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Given a certain actor ID, returns its corresponding snapshot or <b>None</b> if it is not found.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
- def_name: has_actor
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.WorldSnapshot
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.WorldSnapshot
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __self__
|
||||
- param_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Given a certain actor ID, checks if there is a snapshot corresponding it and so, if the actor was present at that moment.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: ActorSnapshot
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that provides access to the data of a carla.Actor in a carla.WorldSnapshot.
|
||||
A class that comprises all the information for an actor at a certain moment in time. These objects are contained in a carla.WorldSnapshot and sent to the client once every tick.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: id
|
||||
type: int
|
||||
doc: >
|
||||
The ActorSnapshot's identifier
|
||||
An identifier for the snapshot itself.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: get_transform
|
||||
return: carla.Transform
|
||||
doc: >
|
||||
Returns the actor's current transform
|
||||
# --------------------------------------
|
||||
- def_name: get_velocity
|
||||
- def_name: get_acceleration
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Returns the actor's current 3D velocity
|
||||
doc: >
|
||||
Returns the acceleration vector registered for an actor in that tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_angular_velocity
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Returns the actor's current 3D angular velocity
|
||||
Returns the angular velocity vector registered for an actor in that tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_acceleration
|
||||
- def_name: get_transform
|
||||
return: carla.Transform
|
||||
doc: >
|
||||
Returns the actor's transform (location and rotation) for an actor in that tick.
|
||||
# --------------------------------------
|
||||
- def_name: get_velocity
|
||||
return: carla.Vector3D
|
||||
doc: >
|
||||
Returns the actor's current 3D acceleration
|
||||
# --------------------------------------
|
||||
- def_name: __self__
|
||||
doc: >
|
||||
doc: >
|
||||
Returns the velocity vector registered for an actor in that tick.
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
|
@ -6,31 +6,29 @@
|
|||
- class_name: WeatherParameters
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
WeatherParameters class is used for requesting and changing the lighting and weather conditions inside the world.
|
||||
This class defines objects containing lightning and weather specifications that can later be applied in carla.World. So far, these conditions only intervene with [sensor.camera.rgb](/bp_library/). They neither affect the actor's physics nor other sensors.
|
||||
Each of these parameters acts indepently from the rest. Increasing the rainfall will not automatically create puddles nor change the road's humidity. That makes for a better customization but means that realistic conditions need to be scripted. However an example of dynamic weather conditions working realistically can be found [here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/dynamic_weather.py).
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: cloudiness
|
||||
type: float
|
||||
doc: >
|
||||
Weather cloudiness. It only affects the RGB camera sensor. Values range from 0 to 100.
|
||||
Values range from 0 to 100, being 0 a clear sky and 100 one completely covered with clouds.
|
||||
# --------------------------------------
|
||||
- var_name: precipitation
|
||||
type: float
|
||||
doc: >
|
||||
Precipitation amount for controlling rain intensity. It only affects the RGB camera sensor.
|
||||
Values range from 0 to 100.
|
||||
Rain intensity values range from 0 to 100, being 0 none at all and 100 a heavy rain.
|
||||
# --------------------------------------
|
||||
- var_name: precipitation_deposits
|
||||
type: float
|
||||
doc: >
|
||||
Precipitation deposits for controlling the area of puddles on roads. It only affects the RGB camera sensor.
|
||||
Values range from 0 to 100.
|
||||
Determines the creation of puddles. Values range from 0 to 100, being 0 none at all and 100 a road completely capped with water. Puddles are created with static noise, meaning that they will always appear at the same locations.
|
||||
# --------------------------------------
|
||||
- var_name: wind_intensity
|
||||
type: float
|
||||
doc: >
|
||||
Wind intensity, it affects the clouds moving speed, the raindrop direction,
|
||||
and vegetation. This doesn't affect the car physics. Values range from 0 to 100.
|
||||
Controls the strenght of the wind with values from 0, no wind at all, to 100, a strong wind. The wind does affect rain direction and leaves from trees, so this value is restricted to avoid animation issues.
|
||||
# --------------------------------------
|
||||
- var_name: fog_density
|
||||
type: float
|
||||
|
@ -50,12 +48,12 @@
|
|||
- var_name: sun_azimuth_angle
|
||||
type: float
|
||||
doc: >
|
||||
The azimuth angle of the sun in degrees. Values range from 0 to 360 (degrees).
|
||||
The azimuth angle of the sun in degrees. Values range from 0 to 360. Zero is an origin point in a sphere determined by Unreal Engine.
|
||||
# --------------------------------------
|
||||
- var_name: sun_altitude_angle
|
||||
type: float
|
||||
doc: >
|
||||
Altitude angle of the sun in degrees. Values range from -90 to 90 (where 0 degrees is the horizon).
|
||||
Altitude angle of the sun in degrees. Values range from -90 to 90 corresponding to midnight and midday each.
|
||||
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
|
@ -64,37 +62,51 @@
|
|||
- param_name: cloudiness
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
0 is a clear sky, 100 complete overcast.
|
||||
- param_name: precipitation
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
0 is no rain at all, 100 a heavy rain.
|
||||
- param_name: precipitation_deposits
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
0 means no puddles on the road, 100 means roads completely capped by rain.
|
||||
- param_name: wind_intensity
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
0 is calm, 100 a strong wind.
|
||||
- param_name: sun_azimuth_angle
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
90 is midday, -90 is midnight.
|
||||
- param_name: sun_altitude_angle
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
0 is an arbitrary North, 180 its corresponding South.
|
||||
note: >
|
||||
ClearNoon, CloudyNoon, WetNoon, WetCloudyNoon, SoftRainNoon, MidRainyNoon, HardRainNoon, ClearSunset, CloudySunset, WetSunset, WetCloudySunset, SoftRainSunset, MidRainSunset, HardRainSunset.
|
||||
doc: >
|
||||
WeatherParameters constructor
|
||||
Method to initialize an object defining weather conditions. This class has some presets for different noon and sunset conditions listed in a note below.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
params:
|
||||
- param_name: other
|
||||
return: bool
|
||||
doc: >
|
||||
Returns True if `self` and `other` are equal
|
||||
Returns <b>True</b> if both objects' variables are the same.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
params:
|
||||
- param_name: other
|
||||
return: bool
|
||||
doc: >
|
||||
Returns True if `self` and `other` are not equal
|
||||
Returns <b>True</b> if both objects' variables are different.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
- class_name: Timestamp
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that contains Timestamp simulated data.
|
||||
Class that contains time information for simulated data. This information is automatically retrieved as part of the carla.WorldSnapshot the client gets on every frame, but might also be used in many other situations such as a carla.Sensor retrieveing data.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: frame
|
||||
|
@ -24,8 +24,7 @@
|
|||
- var_name: platform_timestamp
|
||||
type: float
|
||||
doc: >
|
||||
Time-stamp of the frame at which this measurement was taken, in seconds
|
||||
as given by the OS.
|
||||
Time register of the frame at which this measurement was taken given by the OS in seconds.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
|
@ -59,167 +58,158 @@
|
|||
- class_name: ActorList
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that provides access to actors.
|
||||
A class that contains every actor present on the scene and provides access to them. The list is automatically created and updated by the server and it can be returned using carla.World.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: find
|
||||
params:
|
||||
- param_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Find an actor by ID.
|
||||
# --------------------------------------
|
||||
- def_name: filter
|
||||
params:
|
||||
- param_name: wildcard_pattern
|
||||
type: str
|
||||
doc: >
|
||||
Filters a list of Actors with type_id matching wildcard_pattern.
|
||||
note: >
|
||||
The wildcard_pattern follows Unix shell-style wildcards (fnmatch).
|
||||
# --------------------------------------
|
||||
- def_name: __getitem__
|
||||
return: carla.Actor
|
||||
params:
|
||||
- param_name: pos
|
||||
type: int
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
doc: >
|
||||
Returns the actor corresponding to `pos` position in the list.
|
||||
# --------------------------------------
|
||||
- def_name: __iter__
|
||||
doc: >
|
||||
Allows the iteration for this object.
|
||||
# --------------------------------------
|
||||
- def_name: __len__
|
||||
return: int
|
||||
doc: >
|
||||
Returns the amount of actors listed.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
doc: >
|
||||
Parses to the ID for every actor listed.
|
||||
# --------------------------------------
|
||||
|
||||
- def_name: filter
|
||||
return: list
|
||||
params:
|
||||
- param_name: wildcard_pattern
|
||||
type: str
|
||||
doc: >
|
||||
Filters a list of Actors matching `wildcard_pattern` against their variable **<font color="#f8805a">type_id</font>** (which identifies the blueprint used to spawn them). Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
|
||||
# --------------------------------------
|
||||
- def_name: find
|
||||
return: carla.Actor
|
||||
params:
|
||||
- param_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Finds an actor using its identifier and returns it or <b>None</b> if it is not present.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: WorldSettings
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that provides access to modifiable world settings.
|
||||
Check it out in our [section](../configuring_the_simulation/)
|
||||
The simulation has some advanced configuration options that are contained in this class and can be managed using carla.World and its methods. These allow the user to choose between client-server synchrony/asynchrony, activation of "no rendering mode" and either if the simulation should run with a fixed or variable time-step. Check [this](../configuring_the_simulation/) out if you want to learn about it.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: synchronous_mode
|
||||
type: bool
|
||||
doc: >
|
||||
States the synchrony between client and server. When set to true, the server will wait for a client tick in order to move forward. It is false by default.
|
||||
- var_name: no_rendering_mode
|
||||
type: bool
|
||||
doc: >
|
||||
When enabled, the simulation will run no rendering at all. This is mainly used to avoid overhead during heavy traffic simulations. It is false by default.
|
||||
- var_name: fixed_delta_seconds
|
||||
type: float
|
||||
doc: >
|
||||
Ensures that the time elapsed between two steps of the simulation is fixed. Set this to <b>0.0</b> to work with a variable time-step, as happens by default.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: __init__
|
||||
params:
|
||||
- param_name: synchronous_mode
|
||||
type: bool
|
||||
default: false
|
||||
default: False
|
||||
doc: >
|
||||
Set this to true to enable client-server synchrony.
|
||||
- param_name: no_rendering_mode
|
||||
type: bool
|
||||
default: false
|
||||
default: False
|
||||
doc: >
|
||||
Set this to true to completely disable rendering in the simulation.
|
||||
- param_name: fixed_delta_seconds
|
||||
type: float
|
||||
default: 0.0
|
||||
doc: >
|
||||
Set this time in seconds to get a fixed time-step in between frames. 0.0 means variable time-step and it is the default mode.
|
||||
doc: >
|
||||
Creates an object containing desired settings that could later be applied through carla.World and its method **<font color="#7fb800">apply_settings()</font>**.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Timestamp
|
||||
type: carla.WorldSettings
|
||||
doc: >
|
||||
Settings to be compared with.
|
||||
doc: >
|
||||
Returns <b>True</b> if both objects' variables are the same.
|
||||
# --------------------------------------
|
||||
- def_name: __ne__
|
||||
return: bool
|
||||
params:
|
||||
- param_name: other
|
||||
type: carla.Timestamp
|
||||
type: carla.WorldSettings
|
||||
doc: >
|
||||
Settings to be compared with.
|
||||
doc: >
|
||||
Returns <b>True</b> if both objects' variables are different.
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
return: str
|
||||
doc: >
|
||||
Parses the established settings to a string and shows them in command line.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: AttachmentType
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that defines the attachment options. See carla.World.spawn_actor.<br>
|
||||
Check out this [`recipe`](../python_cookbook/#attach-sensors-recipe)!
|
||||
Class that defines attachment options between an actor and its parent. When spawning actors, these can be attached to another actor so their position changes accordingly. This is specially useful for cameras and sensors. [Here](../python_cookbook/#attach-sensors-recipe) is a brief recipe in which we can see how sensors can be attached to a car when spawned. Note that the attachment type is declared as an enum within the class.
|
||||
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: Rigid
|
||||
doc: >
|
||||
Standard fixed attachment.
|
||||
With this fixed attatchment the object follow its parent position strictly.
|
||||
- var_name: SpringArm
|
||||
doc: >
|
||||
Attachment that expands or retracts based on camera situation.
|
||||
An attachment that expands or retracts depending on camera situation. SpringArms are an Unreal Engine component so [check this out](../python_cookbook/#attach-sensors-recipe) to learn some more about them.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: World
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that contains the current loaded map.
|
||||
World objects are created by the client to have a place for the simulation to happen. The world contains the map we can see, meaning the asset, not the navigation map. Navigation maps are part of the carla.Map class. It also manages the weather and actors present in it. There can only be one world per simulation, but it can be changed anytime.
|
||||
# - PROPERTIES -------------------------
|
||||
instance_variables:
|
||||
- var_name: id
|
||||
type: int
|
||||
doc: >
|
||||
The id of the episode associated with this world.
|
||||
The ID of the episode associated with this world. Episodes are different sessions of a simulation. These change everytime a world is disabled or reloaded. Keeping track is useful to avoid possible issues.
|
||||
- var_name: debug
|
||||
type: carla.DebugHelper
|
||||
doc: >
|
||||
Responsible for creating different shapes for debugging. Take a look at its class to learn more about it.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: get_blueprint_library
|
||||
return: carla.BlueprintLibrary
|
||||
methods:
|
||||
- def_name: __str__
|
||||
return: string
|
||||
doc: >
|
||||
Return the list of blueprints available in this world. These blueprints
|
||||
can be used to spawn actors into the world.
|
||||
# --------------------------------------
|
||||
- def_name: get_map
|
||||
return: carla.Map
|
||||
doc: >
|
||||
Return the map that describes this world.
|
||||
# --------------------------------------
|
||||
- def_name: get_spectator
|
||||
return: carla.Actor
|
||||
doc: >
|
||||
Return the spectator actor. The spectator controls the view in the
|
||||
simulator window.
|
||||
# --------------------------------------
|
||||
- def_name: get_settings
|
||||
return: carla.WorldSettings
|
||||
doc: >
|
||||
# --------------------------------------
|
||||
The content of the world is parsed and printed as a brief report of its current state.
|
||||
# --------------------------------------
|
||||
- def_name: apply_settings
|
||||
return: int
|
||||
params:
|
||||
- param_name: world_settings
|
||||
type: carla.WorldSettings
|
||||
doc: >
|
||||
Returns the id of the frame when the settings took effect.
|
||||
# --------------------------------------
|
||||
- def_name: get_weather
|
||||
return: carla.WeatherParameters
|
||||
doc: >
|
||||
Retrieve the weather parameters currently active in the world.
|
||||
# --------------------------------------
|
||||
- def_name: set_weather
|
||||
params:
|
||||
- param_name: weather
|
||||
type: carla.WeatherParameters
|
||||
doc: >
|
||||
Change the weather in the simulation.
|
||||
# --------------------------------------
|
||||
- def_name: get_snapshot
|
||||
return: carla.WorldSnapshot
|
||||
doc: >
|
||||
Return a snapshot of the world at this moment.
|
||||
This method applies settings contained in an object to the simulation running and returns the ID of the frame they were implemented.
|
||||
# --------------------------------------
|
||||
- def_name: get_actor
|
||||
return: carla.Actor
|
||||
|
@ -227,63 +217,134 @@
|
|||
- param_name: actor_id
|
||||
type: int
|
||||
doc: >
|
||||
Find actor by id, return None if not found.
|
||||
Looks up for an actor by ID and returns <b>None</b> if not found.
|
||||
# --------------------------------------
|
||||
- def_name: get_actors
|
||||
return: carla.ActorList
|
||||
params:
|
||||
- param_name: actor_ids
|
||||
type: list
|
||||
default: None
|
||||
doc: >
|
||||
The IDs of the actors being searched. By default it is set to <b>None</b> and returns every actor on scene.
|
||||
doc: >
|
||||
Retrieves a list of carla.Actor elements, either using a list of IDs provided or just listing everyone on stage. If an ID does not correspond with any actor, it will be excluded from the list returned, meaning that both the list of IDs and the list of actors may have different lengths.
|
||||
# --------------------------------------
|
||||
- def_name: get_blueprint_library
|
||||
return: carla.BlueprintLibrary
|
||||
doc: >
|
||||
Returns a list of actor blueprints available to ease the spawn of these into the world.
|
||||
# --------------------------------------
|
||||
- def_name: get_map
|
||||
return: carla.Map
|
||||
doc: >
|
||||
Returns the object containing the navigation map used to describe this world.
|
||||
# --------------------------------------
|
||||
- def_name: get_random_location_from_navigation
|
||||
return: carla.Location
|
||||
doc: >
|
||||
Retrieve a random location to be used as a destination for walkers in carla.WalkerAIController.go_to_location. See [`spawn_npc.py`](https://github.com/carla-simulator/carla/blob/e73ad54d182e743b50690ca00f1709b08b16528c/PythonAPI/examples/spawn_npc.py#L179) for an example.
|
||||
This can only be used with walkers. It retrieves a random location to be used as a destination using the **<font color="#7fb800">go_to_location()</font>** method in carla.WalkerAIController. This location will be part of a sidewalk. Roads, crosswalks and grass zones are excluded. The method does not take into consideration locations of existing actors so if a collision happens when trying to spawn an actor, it will return an error. Take a look at [`spawn_npc.py`](https://github.com/carla-simulator/carla/blob/e73ad54d182e743b50690ca00f1709b08b16528c/PythonAPI/examples/spawn_npc.py#L179) for an example.
|
||||
# --------------------------------------
|
||||
- def_name: get_actors
|
||||
return: carla.ActorList
|
||||
- def_name: get_snapshot
|
||||
return: carla.WorldSnapshot
|
||||
doc: >
|
||||
By default it returns a list with every actor present in the world.
|
||||
_A list of ids can be used as a parameter_
|
||||
Returns a snapshot of the world at a certain moment comprising all the information about the actors.
|
||||
# --------------------------------------
|
||||
- def_name: get_spectator
|
||||
return: carla.Actor
|
||||
doc: >
|
||||
Returns the spectator actor. The spectator is a special type of actor created by Unreal Engine, usually with ID=0, that acts as a camera and controls the view in the simulator window.
|
||||
# --------------------------------------
|
||||
- def_name: get_settings
|
||||
return: carla.WorldSettings
|
||||
doc: >
|
||||
Returns an object containing some data about the simulation such as synchrony between client and server or rendering mode.
|
||||
# --------------------------------------
|
||||
- def_name: get_weather
|
||||
return: carla.WeatherParameters
|
||||
doc: >
|
||||
Retrieves an object containing weather parameters currently active in the simulation, mainly cloudiness, precipitation, wind and sun position.
|
||||
# --------------------------------------
|
||||
- def_name: on_tick
|
||||
return: int
|
||||
params:
|
||||
- param_name: callback
|
||||
type: carla.WorldSnapshot
|
||||
doc: >
|
||||
A defined function with a snapshot as compulsory parameter that will be called every tick.
|
||||
doc: >
|
||||
The method will start callbacks for a defined function `callback`. It will return the ID for this callback so it can be removed with **<font color="#7fb800">remove_on_tick()</font>**.
|
||||
# --------------------------------------
|
||||
- def_name: remove_on_tick
|
||||
params:
|
||||
- param_name: callback_id
|
||||
type: callback
|
||||
doc: >
|
||||
The callback to be removed.
|
||||
doc: >
|
||||
Stops the callback for `callback_id` started with **<font color="#7fb800">on_tick()</font>**.
|
||||
# --------------------------------------
|
||||
- def_name: set_weather
|
||||
params:
|
||||
- param_name: weather
|
||||
type: carla.WeatherParameters
|
||||
doc: >
|
||||
New conditions to be applied.
|
||||
doc: >
|
||||
Changes the weather parameteres ruling the simulation to another ones defined in an object.
|
||||
# --------------------------------------
|
||||
- def_name: spawn_actor
|
||||
return: carla.Actor
|
||||
params:
|
||||
- param_name: blueprint
|
||||
type: carla.BlueprintLibrary
|
||||
type: carla.ActorBlueprint
|
||||
doc: >
|
||||
The reference from which the actor will be created.
|
||||
- param_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
If attached to parent, transform acts like a relative_transform to the parent actor.
|
||||
Contains the location and orientation the actor will be spawned with.
|
||||
- param_name: attach_to
|
||||
type: carla.Actor
|
||||
default: None
|
||||
doc: >
|
||||
The parent object that the spawned actor will follow around.
|
||||
- param_name: attachment
|
||||
type: carla.AttachmentType
|
||||
default: Rigid
|
||||
doc: >
|
||||
Determines how fixed and rigorous should be the changes in position according to its parent object.
|
||||
doc: >
|
||||
Spawn an actor into the world based on the blueprint provided at
|
||||
transform. If a parent is provided, the actor is attached to
|
||||
parent.
|
||||
The method will create, return and spawn an actor into the world. The actor will need an available blueprint to be created and a transform (location and rotation). It can also be attached to a parent with a certain attachment type.
|
||||
# --------------------------------------
|
||||
- def_name: tick
|
||||
return: int
|
||||
doc: >
|
||||
This only has effect on synchronous mode, when both client and server move together. The method tells the server when to step to the next frame and returns the id of the newly started frame.
|
||||
# --------------------------------------
|
||||
- def_name: try_spawn_actor
|
||||
return: carla.Actor
|
||||
params:
|
||||
- param_name: blueprint
|
||||
type: carla.BlueprintLibrary
|
||||
type: carla.ActorBlueprint
|
||||
doc: >
|
||||
The reference from which the actor will be created.
|
||||
- param_name: transform
|
||||
type: carla.Transform
|
||||
doc: >
|
||||
If attached to parent, transform acts like a relative_transform to the parent actor.
|
||||
Contains the location and orientation the actor will be spawned with.
|
||||
- param_name: attach_to
|
||||
type: carla.Actor
|
||||
default: None
|
||||
doc: >
|
||||
The parent object that the spawned actor will follow around.
|
||||
- param_name: attachment
|
||||
type: carla.AttachmentType
|
||||
default: Rigid
|
||||
doc: >
|
||||
doc: >
|
||||
Determines how fixed and rigorous should be the changes in position according to its parent object.
|
||||
doc: >
|
||||
Same as SpawnActor but return none on failure instead of throwing an
|
||||
exception.
|
||||
Same as **<font color="#7fb800">spawn_actor()</font>** but returns <b>None</b> on failure instead of throwing an exception.
|
||||
# --------------------------------------
|
||||
- def_name: wait_for_tick
|
||||
return: carla.WorldSnapshot
|
||||
|
@ -291,159 +352,157 @@
|
|||
- param_name: seconds
|
||||
type: float
|
||||
default: 10.0
|
||||
doc: >
|
||||
Maximum time in seconds the server should wait for a tick. It is set to 10.0 by default.
|
||||
doc: >
|
||||
Block calling thread until a world tick is received.
|
||||
# --------------------------------------
|
||||
- def_name: on_tick
|
||||
return: int
|
||||
params:
|
||||
- param_name: callback
|
||||
type: carla.WorldSnapshot
|
||||
doc: >
|
||||
Returns the ID of the callback so it can be removed with `remove_on_tick`.
|
||||
# --------------------------------------
|
||||
- def_name: remove_on_tick
|
||||
params:
|
||||
- param_name: callback_id
|
||||
doc: >
|
||||
Removes on tick callbacks.
|
||||
# --------------------------------------
|
||||
- def_name: tick
|
||||
return: int
|
||||
doc: >
|
||||
Synchronizes with the simulator and returns the id of the newly started frame (only has effect on
|
||||
synchronous mode).
|
||||
# --------------------------------------
|
||||
- def_name: __str__
|
||||
doc: >
|
||||
The client tells the server to block calling thread until a **<font color="#7fb800">world_tick()</font>** is received.
|
||||
# --------------------------------------
|
||||
|
||||
- class_name: DebugHelper
|
||||
# - DESCRIPTION ------------------------
|
||||
doc: >
|
||||
Class that provides drawing debug shapes.
|
||||
Check out this [`example`](https://github.com/carla-simulator/carla/blob/master/PythonAPI/util/lane_explorer.py)
|
||||
Helper class part of carla.World that defines methods for creating debug shapes. By default, shapes last one second. They can be permanent, but take into account the resources needed to do so. Check out this [recipe](../python_cookbook/#debug-bounding-box-recipe) where the user takes a snapshot of the world and then proceeds to draw bounding boxes for traffic lights.
|
||||
# - METHODS ----------------------------
|
||||
methods:
|
||||
- def_name: draw_point
|
||||
params:
|
||||
- param_name: location
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Spot in the coordinate system to center the object.
|
||||
- param_name: size
|
||||
type: float
|
||||
default: 0.1f
|
||||
doc: >
|
||||
Density of the point.
|
||||
- param_name: color
|
||||
type: carla.Color
|
||||
default: (255,0,0)
|
||||
doc: >
|
||||
RGB code to color the object. Red by default.
|
||||
- param_name: life_time
|
||||
type: float
|
||||
default: -1.0f
|
||||
- param_name: persistent_lines
|
||||
type: bool
|
||||
default: True
|
||||
doc: >
|
||||
_Deprecated, use `life_time = 0` instead_
|
||||
Lifespan in seconds for the shape. By default it only lasts one frame. Set this to 0 for permanent shapes.
|
||||
doc: >
|
||||
Draws a point in the given location.
|
||||
Draws a point `location`.
|
||||
# --------------------------------------
|
||||
- def_name: draw_line
|
||||
params:
|
||||
- param_name: begin
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Point in the coordinate system where the line starts.
|
||||
- param_name: end
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Spot in the coordinate system where the line ends.
|
||||
- param_name: thickness
|
||||
type: float
|
||||
default: 0.1f
|
||||
doc: >
|
||||
Density of the line.
|
||||
- param_name: color
|
||||
type: carla.Color
|
||||
default: (255,0,0)
|
||||
doc: >
|
||||
RGB code to color the object. Red by default.
|
||||
- param_name: life_time
|
||||
type: float
|
||||
default: -1.0f
|
||||
- param_name: persistent_lines
|
||||
type: bool
|
||||
default: True
|
||||
doc: >
|
||||
_Deprecated, use `life_time = 0` instead_
|
||||
Lifespan in seconds for the shape. By default it only lasts one frame. Set this to 0 for permanent shapes.
|
||||
doc: >
|
||||
Draws a line between two given locations.
|
||||
Draws a line in between `begin` and `end`.
|
||||
# --------------------------------------
|
||||
- def_name: draw_arrow
|
||||
params:
|
||||
- param_name: begin
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Point in the coordinate system where the arrow starts.
|
||||
- param_name: end
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Point in the coordinate system where the arrow ends and points towards to.
|
||||
- param_name: thickness
|
||||
type: float
|
||||
default: 0.1f
|
||||
doc: >
|
||||
Density of the line.
|
||||
- param_name: arrow_size
|
||||
type: float
|
||||
default: 0.1f
|
||||
doc: >
|
||||
Size of the tip of the arrow.
|
||||
- param_name: color
|
||||
type: carla.Color
|
||||
default: (255,0,0)
|
||||
doc: >
|
||||
RGB code to color the object. Red by default.
|
||||
- param_name: life_time
|
||||
type: float
|
||||
default: -1.0f
|
||||
- param_name: persistent_lines
|
||||
type: bool
|
||||
default: True
|
||||
doc: >
|
||||
_Deprecated, use `life_time = 0` instead_
|
||||
Lifespan in seconds for the shape. By default it only lasts one frame. Set this to 0 for permanent shapes.
|
||||
doc: >
|
||||
Draws an arrow between two given locations.
|
||||
Draws an arrow from `begin` to `end` pointing in that direction.
|
||||
|
||||
# --------------------------------------
|
||||
- def_name: draw_box
|
||||
params:
|
||||
- param_name: box
|
||||
type: carla.BoundingBox
|
||||
doc: >
|
||||
Object containing a location and the length of a box for every axis.
|
||||
- param_name: rotation
|
||||
type: carla.Rotation
|
||||
doc: >
|
||||
Orientation of the box according to Unreal Engine's axis system.
|
||||
- param_name: thickness
|
||||
type: float
|
||||
default: 0.1f
|
||||
doc: >
|
||||
Density of the lines that define the box.
|
||||
- param_name: color
|
||||
type: carla.Color
|
||||
default: (255,0,0)
|
||||
doc: >
|
||||
RGB code to color the object. Red by default.
|
||||
- param_name: life_time
|
||||
type: float
|
||||
default: -1.0f
|
||||
- param_name: persistent_lines
|
||||
type: bool
|
||||
default: True
|
||||
doc: >
|
||||
_Deprecated, use `life_time = 0` instead_
|
||||
Lifespan in seconds for the shape. By default it only lasts one frame. Set this to 0 for permanent shapes.
|
||||
doc: >
|
||||
Draws the carla.BoundingBox of a given bounding_box.<br>
|
||||
Check out this [`recipe`](../python_cookbook/#debug-bounding-box-recipe)!
|
||||
Draws a box, ussually to act for object colliders.
|
||||
|
||||
# --------------------------------------
|
||||
- def_name: draw_string
|
||||
params:
|
||||
- param_name: location
|
||||
type: carla.Location
|
||||
doc: >
|
||||
Spot in the simulation where the text will be centered.
|
||||
- param_name: text
|
||||
type: str
|
||||
doc: >
|
||||
Text intended to be shown in the world.
|
||||
- param_name: draw_shadow
|
||||
type: bool
|
||||
default: False
|
||||
doc: >
|
||||
Casts a shadow for the string that could help in visualization. It is disabled by default.
|
||||
- param_name: color
|
||||
type: carla.Color
|
||||
default: (255,0,0)
|
||||
doc: >
|
||||
RGB code to color the string. Red by default.
|
||||
- param_name: life_time
|
||||
type: float
|
||||
default: -1.0f
|
||||
- param_name: persistent_lines
|
||||
type: bool
|
||||
default: true
|
||||
doc: >
|
||||
_Deprecated, set a high `life_time` instead_
|
||||
doc: >
|
||||
Draws a string in a given location.
|
||||
note: >
|
||||
Strings can only be seen on the server-side.
|
||||
Draws a string in a given location of the simulation which can only be seen server-side.
|
||||
# --------------------------------------
|
||||
...
|
||||
|
|
Loading…
Reference in New Issue