#include <Vehicle.h>
Public Types | |
using | AckermannControl = rpc::VehicleAckermannControl |
using | Control = rpc::VehicleControl |
using | LightState = rpc::VehicleLightState::LightState |
using | PhysicsControl = rpc::VehiclePhysicsControl |
using | TM = traffic_manager::TrafficManager |
using | VehicleDoor = rpc::VehicleDoor |
using | WheelLocation = carla::rpc::VehicleWheelLocation |
Public Member Functions | |
void | ApplyAckermannControl (const AckermannControl &control) |
Apply control to this vehicle. More... | |
void | ApplyAckermannControllerSettings (const rpc::AckermannControllerSettings &settings) |
Apply Ackermann control settings to this vehicle. More... | |
void | ApplyControl (const Control &control) |
Apply control to this vehicle. More... | |
void | ApplyPhysicsControl (const PhysicsControl &physics_control) |
Apply physics control to this vehicle. More... | |
void | CloseDoor (const VehicleDoor door_idx) |
Close a door in this vehicle. More... | |
void | EnableCarSim (std::string simfile_path) |
Enables CarSim simulation if it is availiable. More... | |
void | EnableChronoPhysics (uint64_t MaxSubsteps, float MaxSubstepDeltaTime, std::string VehicleJSON="", std::string PowertrainJSON="", std::string TireJSON="", std::string BaseJSONPath="") |
rpc::AckermannControllerSettings | GetAckermannControllerSettings () const |
Return the last Ackermann controller settings applied to this vehicle. More... | |
Control | GetControl () const |
Return the control last applied to this vehicle. More... | |
rpc::VehicleFailureState | GetFailureState () const |
Returns the failure state of the vehicle. More... | |
LightState | GetLightState () const |
Return the current open lights (LightState) of this vehicle. More... | |
PhysicsControl | GetPhysicsControl () const |
Return the physics control last applied to this vehicle. More... | |
float | GetSpeedLimit () const |
Return the speed limit currently affecting this vehicle. More... | |
SharedPtr< TrafficLight > | GetTrafficLight () const |
Retrieve the traffic light actor currently affecting this vehicle. More... | |
rpc::TrafficLightState | GetTrafficLightState () const |
Return the state of the traffic light currently affecting this vehicle. More... | |
float | GetWheelSteerAngle (WheelLocation wheel_location) |
Return a Rotation from a wheel of the vehicle. More... | |
bool | IsAtTrafficLight () |
Return whether a traffic light is affecting this vehicle. More... | |
void | OpenDoor (const VehicleDoor door_idx) |
Open a door in this vehicle. More... | |
void | SetAutopilot (bool enabled=true, uint16_t tm_port=TM_DEFAULT_PORT) |
Switch on/off this vehicle's autopilot. More... | |
void | SetLightState (const LightState &light_state) |
Sets a LightState to this vehicle. More... | |
void | SetWheelSteerDirection (WheelLocation wheel_location, float angle_in_deg) |
Sets a Rotation to a wheel of the vehicle (affects the bone of the car skeleton, not the physics) More... | |
void | ShowDebugTelemetry (bool enabled=true) |
Switch on/off this vehicle's autopilot. More... | |
void | UseCarSimRoad (bool enabled) |
Enables the use of CarSim internal road definition instead of unreal's. More... | |
Vehicle (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 | SetActorDead () |
Set actor as dead and starts his life span. More... | |
void | SetCollisions (bool enabled=true) |
Enable or disable collisions on this actor. More... | |
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< Actor > | GetParent () const |
ActorId | GetParentId () const |
const std::vector< uint8_t > & | GetSemanticTags () const |
const std::string & | GetTypeId () const |
World | GetWorld () const |
Private Attributes | |
Control | _control |
const bool | _is_control_sticky |
Additional Inherited Members | |
Protected Member Functions inherited from carla::client::detail::ActorState | |
ActorState (rpc::Actor description, EpisodeProxy episode) | |
const rpc::Actor & | GetActorDescription () const |
const geom::BoundingBox & | GetBoundingBox () const |
EpisodeProxy & | GetEpisode () |
const EpisodeProxy & | GetEpisode () const |
|
explicit |
Definition at line 34 of file Vehicle.cpp.
void carla::client::Vehicle::ApplyAckermannControl | ( | const AckermannControl & | control | ) |
Apply control to this vehicle.
Definition at line 58 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::ApplyAckermannControllerSettings | ( | const rpc::AckermannControllerSettings & | settings | ) |
Apply Ackermann control settings to this vehicle.
Definition at line 66 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::ApplyControl | ( | const Control & | control | ) |
Apply control to this vehicle.
Definition at line 51 of file Vehicle.cpp.
References _control, _is_control_sticky, carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::ApplyPhysicsControl | ( | const PhysicsControl & | physics_control | ) |
Apply physics control to this vehicle.
Definition at line 70 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::CloseDoor | ( | const VehicleDoor | door_idx | ) |
Close a door in this vehicle.
Definition at line 78 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::EnableCarSim | ( | std::string | simfile_path | ) |
Enables CarSim simulation if it is availiable.
Definition at line 123 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::EnableChronoPhysics | ( | uint64_t | MaxSubsteps, |
float | MaxSubstepDeltaTime, | ||
std::string | VehicleJSON = "" , |
||
std::string | PowertrainJSON = "" , |
||
std::string | TireJSON = "" , |
||
std::string | BaseJSONPath = "" |
||
) |
Definition at line 131 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
rpc::AckermannControllerSettings carla::client::Vehicle::GetAckermannControllerSettings | ( | ) | const |
Return the last Ackermann controller settings applied to this vehicle.
Definition at line 62 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
Vehicle::Control carla::client::Vehicle::GetControl | ( | ) | const |
Return the control last applied to this vehicle.
Definition at line 94 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
Referenced by carla::rss::RssCheck::GetSteeringAngle().
rpc::VehicleFailureState carla::client::Vehicle::GetFailureState | ( | ) | const |
Returns the failure state of the vehicle.
Definition at line 147 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
Vehicle::LightState carla::client::Vehicle::GetLightState | ( | ) | const |
Return the current open lights (LightState) of this vehicle.
Definition at line 102 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
Vehicle::PhysicsControl carla::client::Vehicle::GetPhysicsControl | ( | ) | const |
Return the physics control last applied to this vehicle.
Definition at line 98 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
float carla::client::Vehicle::GetSpeedLimit | ( | ) | const |
Return the speed limit currently affecting this vehicle.
Definition at line 106 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
Referenced by carla::traffic_manager::ALSM::UpdateUnregisteredActorsData().
SharedPtr< TrafficLight > carla::client::Vehicle::GetTrafficLight | ( | ) | const |
Retrieve the traffic light actor currently affecting this vehicle.
Definition at line 118 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), carla::client::detail::ActorState::GetWorld(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
rpc::TrafficLightState carla::client::Vehicle::GetTrafficLightState | ( | ) | const |
Return the state of the traffic light currently affecting this vehicle.
Definition at line 110 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
float carla::client::Vehicle::GetWheelSteerAngle | ( | WheelLocation | wheel_location | ) |
Return a Rotation from a wheel of the vehicle.
Definition at line 90 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
bool carla::client::Vehicle::IsAtTrafficLight | ( | ) |
Return whether a traffic light is affecting this vehicle.
Definition at line 114 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::OpenDoor | ( | const VehicleDoor | door_idx | ) |
Open a door in this vehicle.
Definition at line 74 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::SetAutopilot | ( | bool | enabled = true , |
uint16_t | tm_port = TM_DEFAULT_PORT |
||
) |
Switch on/off this vehicle's autopilot.
Definition at line 38 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), carla::traffic_manager::TrafficManager::RegisterVehicles(), and carla::traffic_manager::TrafficManager::UnregisterVehicles().
void carla::client::Vehicle::SetLightState | ( | const LightState & | light_state | ) |
Sets a LightState to this vehicle.
Definition at line 82 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::SetWheelSteerDirection | ( | WheelLocation | wheel_location, |
float | angle_in_deg | ||
) |
Sets a Rotation to a wheel of the vehicle (affects the bone of the car skeleton, not the physics)
Definition at line 86 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::ShowDebugTelemetry | ( | bool | enabled = true | ) |
Switch on/off this vehicle's autopilot.
Definition at line 47 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
void carla::client::Vehicle::UseCarSimRoad | ( | bool | enabled | ) |
Enables the use of CarSim internal road definition instead of unreal's.
Definition at line 127 of file Vehicle.cpp.
References carla::client::detail::ActorState::GetEpisode(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
|
private |
Definition at line 147 of file Vehicle.h.
Referenced by ApplyControl().
|
private |
Definition at line 145 of file Vehicle.h.
Referenced by ApplyControl().