CARLA
Public Member Functions | List of all members
carla::client::TrafficLight Class Reference

#include <TrafficLight.h>

+ Inheritance diagram for carla::client::TrafficLight:
+ Collaboration diagram for carla::client::TrafficLight:

Public Member Functions

void Freeze (bool freeze)
 
std::vector< SharedPtr< Waypoint > > GetAffectedLaneWaypoints () const
 
float GetElapsedTime () const
 
float GetGreenTime () const
 
std::vector< SharedPtr< TrafficLight > > GetGroupTrafficLights ()
 Return all traffic lights in the group this one belongs to. More...
 
std::vector< geom::BoundingBoxGetLightBoxes () const
 
road::SignId GetOpenDRIVEID () const
 
uint32_t GetPoleIndex ()
 Returns the index of the pole in the traffic light group. More...
 
float GetRedTime () const
 
rpc::TrafficLightState GetState () const
 Return the current state of the traffic light. More...
 
std::vector< SharedPtr< Waypoint > > GetStopWaypoints () const
 
float GetYellowTime () const
 
bool IsFrozen () const
 
void ResetGroup ()
 
void SetGreenTime (float green_time)
 
void SetRedTime (float red_time)
 
void SetState (rpc::TrafficLightState state)
 
void SetYellowTime (float yellow_time)
 
 TrafficLight (ActorInitializer init)
 
- Public Member Functions inherited from carla::client::TrafficSign
carla::road::SignId GetSignId () const
 
const geom::BoundingBoxGetTriggerVolume () const
 
 TrafficSign (ActorInitializer init)
 
- Public Member Functions inherited from carla::client::Actor
 Actor (ActorInitializer init)
 
void AddAngularImpulse (const geom::Vector3D &vector)
 Add angular impulse to the actor. More...
 
void AddForce (const geom::Vector3D &force)
 Add force to the actor at its center of mass. More...
 
void AddForce (const geom::Vector3D &force, const geom::Vector3D &location)
 Add force to the actor at certain location. More...
 
void AddImpulse (const geom::Vector3D &vector)
 Add impulse to the actor at its center of mass. More...
 
void AddImpulse (const geom::Vector3D &impulse, const geom::Vector3D &location)
 Add impulse to the actor at certain location. More...
 
void AddTorque (const geom::Vector3D &vector)
 Add a torque to the actor. More...
 
virtual bool Destroy ()
 Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed. More...
 
void DisableConstantVelocity ()
 Disable the constant velocity mode. More...
 
void EnableConstantVelocity (const geom::Vector3D &vector)
 Enable a constant velocity mode. More...
 
geom::Vector3D GetAcceleration () const
 Return the current 3D acceleration of the actor. More...
 
rpc::ActorState GetActorState () const
 
geom::Vector3D GetAngularVelocity () const
 Return the current 3D angular velocity of the actor. More...
 
geom::Location GetLocation () const
 Return the current location of the actor. More...
 
geom::Transform GetTransform () const
 Return the current transform of the actor. More...
 
geom::Vector3D GetVelocity () const
 Return the current 3D velocity of the actor. More...
 
bool IsActive () const
 
bool IsAlive () const
 
bool IsDormant () const
 
const auto & Serialize () const
 
void SetEnableGravity (bool enabled=true)
 Enable or disable gravity on this actor. More...
 
void SetLocation (const geom::Location &location)
 Teleport the actor to location. More...
 
void SetSimulatePhysics (bool enabled=true)
 Enable or disable physics simulation on this actor. More...
 
void SetTargetAngularVelocity (const geom::Vector3D &vector)
 Set the angular velocity of the actor before applying physics. More...
 
void SetTargetVelocity (const geom::Vector3D &vector)
 Set the actor velocity before applying physics. More...
 
void SetTransform (const geom::Transform &transform)
 Teleport and rotate the actor to transform. More...
 
virtual ~Actor ()=default
 
- Public Member Functions inherited from carla::client::detail::ActorState
const std::vector< ActorAttributeValue > & GetAttributes () const
 
const std::string & GetDisplayId () const
 
ActorId GetId () const
 
SharedPtr< ActorGetParent () const
 
ActorId GetParentId () const
 
const std::vector< uint8_t > & GetSemanticTags () const
 
const std::string & GetTypeId () const
 
World GetWorld () const
 

Additional Inherited Members

- Protected Member Functions inherited from carla::client::detail::ActorState
 ActorState (rpc::Actor description, EpisodeProxy episode)
 
const rpc::ActorGetActorDescription () const
 
const geom::BoundingBoxGetBoundingBox () const
 
EpisodeProxyGetEpisode ()
 
const EpisodeProxyGetEpisode () const
 

Detailed Description

Definition at line 18 of file TrafficLight.h.

Constructor & Destructor Documentation

◆ TrafficLight()

carla::client::TrafficLight::TrafficLight ( ActorInitializer  init)
inlineexplicit

Definition at line 22 of file TrafficLight.h.

References Freeze(), GetAffectedLaneWaypoints(), GetElapsedTime(), GetGreenTime(), GetGroupTrafficLights(), GetLightBoxes(), GetOpenDRIVEID(), GetPoleIndex(), GetRedTime(), GetState(), GetStopWaypoints(), GetYellowTime(), IsFrozen(), ResetGroup(), SetGreenTime(), SetRedTime(), SetState(), and SetYellowTime().

+ Here is the call graph for this function:

Member Function Documentation

◆ Freeze()

void carla::client::TrafficLight::Freeze ( bool  freeze)

Definition at line 53 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAffectedLaneWaypoints()

std::vector< SharedPtr< Waypoint > > carla::client::TrafficLight::GetAffectedLaneWaypoints ( ) const

Definition at line 81 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), GetOpenDRIVEID(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetElapsedTime()

float carla::client::TrafficLight::GetElapsedTime ( ) const
Note
This function does not call the simulator, it returns the data received in the last tick.

Definition at line 49 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetGreenTime()

float carla::client::TrafficLight::GetGreenTime ( ) const
Note
This function does not call the simulator, it returns the data received in the last tick.

Definition at line 29 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetGroupTrafficLights()

std::vector< SharedPtr< TrafficLight > > carla::client::TrafficLight::GetGroupTrafficLights ( )

Return all traffic lights in the group this one belongs to.

Note
This function calls the simulator

Definition at line 67 of file TrafficLight.cpp.

References carla::client::World::GetActors(), carla::client::detail::ActorState::GetEpisode(), carla::client::detail::ActorState::GetWorld(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLightBoxes()

std::vector< geom::BoundingBox > carla::client::TrafficLight::GetLightBoxes ( ) const

Definition at line 107 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetOpenDRIVEID()

road::SignId carla::client::TrafficLight::GetOpenDRIVEID ( ) const

Definition at line 111 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by GetAffectedLaneWaypoints(), and TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPoleIndex()

uint32_t carla::client::TrafficLight::GetPoleIndex ( )

Returns the index of the pole in the traffic light group.

Definition at line 62 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRedTime()

float carla::client::TrafficLight::GetRedTime ( ) const
Note
This function does not call the simulator, it returns the data received in the last tick.

Definition at line 45 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetState()

rpc::TrafficLightState carla::client::TrafficLight::GetState ( ) const

Return the current state of the traffic light.

Note
This function does not call the simulator, it returns the data received in the last tick.

Definition at line 21 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by carla::traffic_manager::MotionPlanStage::GetLandmarkTargetVelocity(), and TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetStopWaypoints()

std::vector< SharedPtr< Waypoint > > carla::client::TrafficLight::GetStopWaypoints ( ) const

Definition at line 115 of file TrafficLight.cpp.

References carla::geom::BoundingBox::extent, carla::client::detail::ActorState::GetEpisode(), carla::geom::Transform::GetForwardVector(), carla::client::Actor::GetTransform(), carla::client::TrafficSign::GetTriggerVolume(), carla::geom::BoundingBox::location, carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), carla::geom::Transform::TransformPoint(), and carla::geom::Vector3D::x.

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetYellowTime()

float carla::client::TrafficLight::GetYellowTime ( ) const
Note
This function does not call the simulator, it returns the data received in the last tick.

Definition at line 37 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsFrozen()

bool carla::client::TrafficLight::IsFrozen ( ) const
Note
This function does not call the simulator, it returns the data received in the last tick.

Definition at line 58 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResetGroup()

void carla::client::TrafficLight::ResetGroup ( )

Definition at line 77 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetGreenTime()

void carla::client::TrafficLight::SetGreenTime ( float  green_time)

Definition at line 25 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRedTime()

void carla::client::TrafficLight::SetRedTime ( float  red_time)

Definition at line 41 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetState()

void carla::client::TrafficLight::SetState ( rpc::TrafficLightState  state)

Definition at line 17 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetYellowTime()

void carla::client::TrafficLight::SetYellowTime ( float  yellow_time)

Definition at line 33 of file TrafficLight.cpp.

References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().

Referenced by TrafficLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: