CARLA
Public Member Functions | Private Types | List of all members
carla::client::Actor Class Reference

Represents an actor in the simulation. More...

#include <Actor.h>

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

Public Member Functions

 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
 

Private Types

using Super = detail::ActorState
 

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
 
- Private Member Functions inherited from carla::profiler::LifetimeProfiled
 LifetimeProfiled ()=default
 

Detailed Description

Represents an actor in the simulation.

Definition at line 18 of file client/Actor.h.

Member Typedef Documentation

◆ Super

using carla::client::Actor::Super = detail::ActorState
private

Definition at line 22 of file client/Actor.h.

Constructor & Destructor Documentation

◆ Actor()

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

Definition at line 25 of file client/Actor.h.

References AddAngularImpulse(), AddForce(), AddImpulse(), AddTorque(), DisableConstantVelocity(), EnableConstantVelocity(), GetAcceleration(), GetActorState(), GetAngularVelocity(), GetLocation(), GetTransform(), GetVelocity(), SetEnableGravity(), SetLocation(), SetSimulatePhysics(), SetTargetAngularVelocity(), SetTargetVelocity(), SetTransform(), and ~Actor().

+ Here is the call graph for this function:

◆ ~Actor()

virtual carla::client::Actor::~Actor ( )
virtualdefault

Referenced by Actor().

+ Here is the caller graph for this function:

Member Function Documentation

◆ AddAngularImpulse()

void carla::client::Actor::AddAngularImpulse ( const geom::Vector3D vector)

Add angular impulse to the actor.

Definition at line 75 of file Actor.cpp.

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

Referenced by Actor().

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

◆ AddForce() [1/2]

void carla::client::Actor::AddForce ( const geom::Vector3D force)

Add force to the actor at its center of mass.

Definition at line 67 of file Actor.cpp.

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

Referenced by Actor().

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

◆ AddForce() [2/2]

void carla::client::Actor::AddForce ( const geom::Vector3D force,
const geom::Vector3D location 
)

Add force to the actor at certain location.

Definition at line 71 of file Actor.cpp.

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

+ Here is the call graph for this function:

◆ AddImpulse() [1/2]

void carla::client::Actor::AddImpulse ( const geom::Vector3D vector)

Add impulse to the actor at its center of mass.

Definition at line 59 of file Actor.cpp.

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

Referenced by Actor().

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

◆ AddImpulse() [2/2]

void carla::client::Actor::AddImpulse ( const geom::Vector3D impulse,
const geom::Vector3D location 
)

Add impulse to the actor at certain location.

Definition at line 63 of file Actor.cpp.

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

+ Here is the call graph for this function:

◆ AddTorque()

void carla::client::Actor::AddTorque ( const geom::Vector3D vector)

Add a torque to the actor.

Definition at line 79 of file Actor.cpp.

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

Referenced by Actor().

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

◆ Destroy()

bool carla::client::Actor::Destroy ( )
virtual

Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed.

Note
It has no effect if the Actor was already successfully destroyed.
Warning
This function blocks until the destruction operation is completed by the simulator.

Reimplemented in carla::client::ServerSideSensor.

Definition at line 95 of file Actor.cpp.

References GetActorState(), carla::client::detail::ActorState::GetDisplayId(), carla::client::detail::ActorState::GetEpisode(), carla::rpc::Invalid, carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), and carla::log_warning().

Referenced by carla::client::ServerSideSensor::Destroy(), and IsActive().

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

◆ DisableConstantVelocity()

void carla::client::Actor::DisableConstantVelocity ( )

Disable the constant velocity mode.

Definition at line 55 of file Actor.cpp.

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

Referenced by Actor().

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

◆ EnableConstantVelocity()

void carla::client::Actor::EnableConstantVelocity ( const geom::Vector3D vector)

Enable a constant velocity mode.

Definition at line 51 of file Actor.cpp.

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

Referenced by Actor().

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

◆ GetAcceleration()

geom::Vector3D carla::client::Actor::GetAcceleration ( ) const

Return the current 3D acceleration of the actor.

Note
This function does not call the simulator, it returns the acceleration calculated after the actor's velocity.

Definition at line 31 of file Actor.cpp.

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

Referenced by Actor().

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

◆ GetActorState()

rpc::ActorState carla::client::Actor::GetActorState ( ) const

Definition at line 91 of file Actor.cpp.

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

Referenced by Actor(), Destroy(), IsActive(), IsAlive(), and IsDormant().

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

◆ GetAngularVelocity()

geom::Vector3D carla::client::Actor::GetAngularVelocity ( ) const

Return the current 3D angular velocity of the actor.

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

Definition at line 27 of file Actor.cpp.

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

Referenced by Actor(), and carla::rss::RssCheck::GetHeadingChange().

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

◆ GetLocation()

geom::Location carla::client::Actor::GetLocation ( ) const

Return the current location of the actor.

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

Definition at line 15 of file Actor.cpp.

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

Referenced by Actor().

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

◆ GetTransform()

geom::Transform carla::client::Actor::GetTransform ( ) const

Return the current transform of the actor.

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

Definition at line 19 of file Actor.cpp.

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

Referenced by Actor(), carla::rss::RssCheck::CreateWorldModel(), carla::rss::RssCheck::GetSpeed(), carla::client::TrafficLight::GetStopWaypoints(), and carla::client::RssSensor::TickRssSensorThreadLocked().

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

◆ GetVelocity()

geom::Vector3D carla::client::Actor::GetVelocity ( ) const

Return the current 3D velocity of the actor.

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

Definition at line 23 of file Actor.cpp.

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

Referenced by Actor(), and carla::rss::RssCheck::GetSpeed().

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

◆ IsActive()

bool carla::client::Actor::IsActive ( ) const
inline

Definition at line 115 of file client/Actor.h.

References carla::rpc::Active, Destroy(), GetActorState(), carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::IsValid().

+ Here is the call graph for this function:

◆ IsAlive()

bool carla::client::Actor::IsAlive ( ) const
inline

Definition at line 107 of file client/Actor.h.

References GetActorState(), carla::client::detail::ActorState::GetEpisode(), carla::rpc::Invalid, carla::client::detail::EpisodeProxyImpl< PointerT >::IsValid(), and carla::rpc::PendingKill.

Referenced by carla::client::ServerSideSensor::~ServerSideSensor().

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

◆ IsDormant()

bool carla::client::Actor::IsDormant ( ) const
inline

Definition at line 111 of file client/Actor.h.

References carla::rpc::Dormant, GetActorState(), carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::IsValid().

+ Here is the call graph for this function:

◆ Serialize()

const auto& carla::client::Actor::Serialize ( ) const
inline

Definition at line 128 of file client/Actor.h.

◆ SetEnableGravity()

void carla::client::Actor::SetEnableGravity ( bool  enabled = true)

Enable or disable gravity on this actor.

Definition at line 87 of file Actor.cpp.

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

Referenced by Actor().

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

◆ SetLocation()

void carla::client::Actor::SetLocation ( const geom::Location location)

Teleport the actor to location.

Definition at line 35 of file Actor.cpp.

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

Referenced by Actor().

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

◆ SetSimulatePhysics()

void carla::client::Actor::SetSimulatePhysics ( bool  enabled = true)

Enable or disable physics simulation on this actor.

Definition at line 83 of file Actor.cpp.

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

Referenced by Actor().

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

◆ SetTargetAngularVelocity()

void carla::client::Actor::SetTargetAngularVelocity ( const geom::Vector3D vector)

Set the angular velocity of the actor before applying physics.

Definition at line 47 of file Actor.cpp.

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

Referenced by Actor().

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

◆ SetTargetVelocity()

void carla::client::Actor::SetTargetVelocity ( const geom::Vector3D vector)

Set the actor velocity before applying physics.

Definition at line 43 of file Actor.cpp.

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

Referenced by Actor().

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

◆ SetTransform()

void carla::client::Actor::SetTransform ( const geom::Transform transform)

Teleport and rotate the actor to transform.

Definition at line 39 of file Actor.cpp.

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

Referenced by Actor().

+ 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: