66 return cloe::utility::ActuationLevel::None;
69 virtual void reset(){};
71 virtual cloe::Json to_json()
const = 0;
73 friend void to_json(cloe::Json& j,
const VtdVehicleControl& vc) { j = vc.to_json(); }
93 : LatLongActuator(
"vtd/lat_long_actuator"), task_control_(tc), vehicle_id_(
id) {}
114 old_level_.set_none();
115 LatLongActuator::reset();
116 task_control_->reset();
120 add_driver_control();
122 if (this->has_level_change()) {
123 vtd_logger()->info(
"VtdLatLongActuator: vehicle {} controller state: {}",
id(),
124 level_.to_human_cstr());
133 bool has_level_change() {
return old_level_ != this->level_; }
135 void add_driver_control() {
139 if (is_acceleration()) {
144 if (is_steering_angle()) {
149 if (is_acceleration() || is_steering_angle()) {
151 task_control_->add_driver_control(dc);
156 std::shared_ptr<TaskControl> task_control_;
157 uint64_t vehicle_id_;
175 VtdExternalEgoModel(std::shared_ptr<TaskControl> tc, uint64_t
id,
const std::string& veh_name)
176 : VehicleStateModel(
"vtd/ego_state")
179 , vehicle_name_(veh_name) {}
190 if (this->is_vehicle_state()) {
191 add_dyn_object_state();
192 }
else if (sync.
step() > 1) {
199 VehicleStateModel::reset();
200 task_control_->reset();
203 cloe::Json to_json()
const override {
208 void add_dyn_object_state() {
209 auto ego_state = this->vehicle_state();
212 assert(static_cast<uint64_t>(ego_state->id) == vehicle_id_);
217 os.
base_pos = rdb_coord_from_object(ego_state.get());
218 os.
ext_speed = rdb_coord_from_vector3d(ego_state->velocity, ego_state->angular_velocity);
219 os.
ext_accel = rdb_coord_pos_from_vector3d(ego_state->acceleration);
221 task_control_->add_dyn_object_state(os);
225 std::shared_ptr<TaskControl> task_control_;
226 uint64_t vehicle_id_;
227 std::string vehicle_name_;
void step_begin(const cloe::Sync &sync) override
Definition: actuator_component.hpp:189
uint32_t validity_flags
Definition: task_control.hpp:68
RDB_COORD_t ext_accel
Object acceleration and angular acceleration.
Definition: task_control.hpp:107
Definition: task_control.hpp:43
Definition: actuator_component.hpp:90
float target_acceleration
Target acceleration in [m/s^2].
Definition: task_control.hpp:48
RDB_COORD_t base_pos
Object position and orientation.
Definition: task_control.hpp:101
Definition: task_control.hpp:81
cloe::utility::ActuationLevel get_actuation_level() override
Definition: actuator_component.hpp:109
Definition: actuator_component.hpp:37
bool update_vehicle_label() override
Definition: actuator_component.hpp:107
Definition: actuator_component.hpp:35
virtual uint64_t step() const =0
uint8_t base_type
Object type (car, truck, ...).
Definition: task_control.hpp:89
const std::map< cloe::Object::Class, uint8_t > cloe_vtd_obj_class_map
Definition: task_control.hpp:121
void reset() override
Definition: actuator_component.hpp:113
virtual void step_end(const cloe::Sync &)
Definition: actuator_component.hpp:55
cloe::Duration process(const cloe::Sync &sync) override
Definition: actuator_component.hpp:111
std::string base_name
Player name.
Definition: task_control.hpp:95
std::chrono::nanoseconds Duration
Definition: duration.hpp:45
virtual bool update_vehicle_label()
Definition: actuator_component.hpp:60
void reset() override
Definition: actuator_component.hpp:198
virtual cloe::utility::ActuationLevel get_actuation_level()
Definition: actuator_component.hpp:65
uint32_t player_id
VTD player ID.
Definition: task_control.hpp:45
RDB_GEOMETRY_t rdb_geometry_from_object(const cloe::Object &obj)
Definition: task_control.hpp:131
virtual void step_begin(const cloe::Sync &sync)=0
Definition: vehicle_state_model.hpp:36
RDB_COORD_t ext_speed
Object velocity and angular velocity.
Definition: task_control.hpp:104
void step_end(const cloe::Sync &) override
Definition: actuator_component.hpp:128
float target_steering
Target steering angle in [rad].
Definition: task_control.hpp:51
Definition: actuation_level.hpp:50
uint32_t base_id
Object id.
Definition: task_control.hpp:83
RDB_GEOMETRY_t base_geo
Object dimension and offset to cog.
Definition: task_control.hpp:98
Definition: actuator_component.hpp:173
Definition: latlong_actuator.hpp:38
void step_begin(const cloe::Sync &) override
Definition: actuator_component.hpp:119