$darkmode
#include <task_control.hpp>
Public Member Functions | |
| TaskControl (std::unique_ptr< RdbTransceiver > &&rdb_transceiver) | |
| void | process (RDB_DRIVER_CTRL_t *driver_ctrl) override |
| void | reset () override |
| void | add_driver_control (const DriverControl &dc) |
| void | add_dyn_object_state (const DynObjectState &os) |
| void | add_trigger (cloe::Duration delta_t) |
| void | send_packages () |
| void | add_trigger_and_send (cloe::Duration delta_t) |
| double | get_steering_wheel_speed (uint64_t id) const |
| double | get_driver_request_acceleration (uint64_t id) const |
| bool | has_driver_request_acceleration (uint64_t id) |
| double | get_driver_request_steering_angle (uint64_t id) const |
| bool | has_driver_request_steering_angle (uint64_t id) |
Public Member Functions inherited from vtd::VtdOmniSensor | |
| VtdOmniSensor (std::unique_ptr< RdbTransceiver > &&rdb_transceiver, uint64_t owner_id) | |
| void | step (const cloe::Sync &s) override |
| void | process (RDB_START_OF_FRAME_t *) override |
| void | process (RDB_END_OF_FRAME_t *) override |
| void | process (RDB_WHEEL_t *rdb_w, bool) override |
| void | process (RDB_SENSOR_STATE_t *s) override |
| void | process (RDB_OBJECT_STATE_t *rdb_os, bool extended) override |
| void | process (RDB_ROADMARK_t *rdb_rm) override |
| const std::string & | get_name () const override |
Public Member Functions inherited from vtd::RdbCodec | |
| RdbCodec (std::unique_ptr< RdbTransceiver > &&rdb_transceiver) | |
| RdbCodec (RdbTransceiver *rdb_transceiver) | |
| virtual uint64_t | frame_number () const |
| virtual void | step (uint64_t frame_number, bool &restart, cloe::Duration &sim_time) |
| virtual void | process (RDB_MSG_t *msg, bool &restart, cloe::Duration &sim_time) |
| virtual void | process (RDB_MSG_ENTRY_HDR_t *entry) |
| virtual void | process (RDB_COORD_SYSTEM_t *) |
| virtual void | process (RDB_COORD_t *) |
| virtual void | process (RDB_ROAD_POS_t *) |
| virtual void | process (RDB_LANE_INFO_t *) |
| virtual void | process (RDB_OBJECT_CFG_t *) |
| virtual void | process (RDB_VEHICLE_SYSTEMS_t *) |
| virtual void | process (RDB_VEHICLE_SETUP_t *) |
| virtual void | process (RDB_ENGINE_t *, bool) |
| virtual void | process (RDB_DRIVETRAIN_t *, bool) |
| virtual void | process (RDB_PED_ANIMATION_t *) |
| virtual void | process (RDB_SENSOR_OBJECT_t *) |
| virtual void | process (RDB_CAMERA_t *) |
| virtual void | process (RDB_CONTACT_POINT_t *) |
| virtual void | process (RDB_TRAFFIC_SIGN_t *) |
| virtual void | process (RDB_ROAD_STATE_t *) |
| virtual void | process (RDB_IMAGE_t *) |
| virtual void | process (RDB_LIGHT_SOURCE_t *, bool) |
| virtual void | process (RDB_ENVIRONMENT_t *) |
| virtual void | process (RDB_TRIGGER_t *) |
| virtual void | process (RDB_TRAFFIC_LIGHT_t *, bool) |
| virtual void | process (RDB_SYNC_t *) |
| virtual void | process (RDB_DRIVER_PERCEPTION_t *) |
| virtual void | process (RDB_FUNCTION_t *) |
| virtual void | process (RDB_ROAD_QUERY_t *) |
| virtual void | process (RDB_TRAJECTORY_t *) |
| virtual void | process (RDB_DYN_2_STEER_t *) |
| virtual void | process (RDB_STEER_2_DYN_t *) |
| virtual void | process (RDB_PROXY_t *) |
| virtual void | process (RDB_MOTION_SYSTEM_t *) |
| virtual void | process (RDB_FREESPACE_t *) |
| virtual void | process (RDB_DYN_EL_SWITCH_t *) |
| virtual void | process (RDB_DYN_EL_DOF_t *) |
| virtual void | process (RDB_IG_FRAME_t *) |
| virtual void | process (RDB_RT_PERFORMANCE_t *) |
| virtual void | process (RDB_CUSTOM_SCORING_t *) |
| virtual void | process (RDB_CUSTOM_OBJECT_CTRL_TRACK_t *) |
Public Member Functions inherited from vtd::VtdSensorData | |
| VtdSensorData (const std::string &name) | |
| virtual cloe::Duration | simulation_time () const |
| virtual void | set_name (const std::string &name) |
| virtual void | set_reset_state () |
| const cloe::Object & | get_ego_object () const |
| const cloe::Objects & | get_world_objects () const |
| double | get_ego_steering_angle () const |
| const cloe::Frustum & | get_frustum () const |
| const Eigen::Isometry3d & | get_mount_pose () const |
| const cloe::LaneBoundaries & | get_lane_boundaries () |
| void | clear_cache () |
Protected Attributes | |
| Framework::RDBHandler | handler_ |
| RDBHandler helps us conveniently construct RDB messages. | |
| std::map< int, double > | steering_wheel_speed_ |
| std::map< int, double > | driver_request_accel_ |
| std::map< int, double > | driver_request_steering_angle_ |
Protected Attributes inherited from vtd::VtdOmniSensor | |
| uint64_t | owner_id_ |
| Id of the sensor's owner (ego). | |
Protected Attributes inherited from vtd::RdbCodec | |
| std::unique_ptr< RdbTransceiver > | rdb_ |
| uint64_t | frame_number_ = 0 |
| Frame number from last processed RDB message. | |
| bool | processing_frame_ = false |
| Indicates whether in between a start of frame and an end of frame message. | |
Protected Attributes inherited from vtd::VtdSensorData | |
| std::string | name_ = "default_sensor" |
| Human readable name. | |
| bool | restart_ = false |
| Indicates whether reset has been requested. | |
| cloe::Duration | simulation_time_ = cloe::Duration(0) |
| Simulation time from last processed sensor message. | |
| Eigen::Isometry3d | mount_ |
| Sensor mounting position and orientation. | |
| cloe::Frustum | frustum_ |
| Sensor frustum information. | |
| cloe::Objects | world_objects_ |
| World objects from last processed frame. | |
| std::shared_ptr< cloe::Object > | ego_object_ |
| ego object information from last processed frame. | |
| double | ego_steering_angle_ {0.0} |
| Ego front left wheel steering angle from last processed frame. | |
| cloe::LaneBoundaries | lanes_ |
| Lane id-to-boundary-map. | |
Friends | |
| void | to_json (cloe::Json &j, const TaskControl &tc) |
TaskControl contains the connection to the VTD task control server.
In the usual basic single machine configurations of VTD, there is only one instance of task control server running.
This class implements
The idea is that the VtdOmniSensor baseclass receives all groundtruth data and exposes it at the default cloe groundtruth sensor's component-interfaces. Then you add any packages to the task control that you want to send, and once you've done that, you send the packages, which packs the buffer and sends it off.
Contrived example:
TaskControl tc{new RdbTransceiver("localhost", 23456)};
this->new_component(new VtdWorldSensor{tc}, CloeComponent::GROUNDTRUTH_WORLD_SENSOR); ... DriverControl dc; dc.player_id = 1; dc.target_acceleration = 2.0; ... tc.add_driver_control(dc); ... tc.add_trigger(cloe::Milliseconds(20)); tc.send_packages()
Of course, all these statements will be sprinkled around your code.
|
inline |
Add driver control to the RDB message for the current frame.
|
inline |
Add the trigger package, which specifies how much VTD should step.
|
inline |
Add the given trigger and then send it.
A common idiom is to set the trigger and then right away send the package to VTD. This will also send any other packages.
|
inline |
Get driver-requested longitudinal acceleration of vehicle with given id [m/s2].
|
inline |
Get driver-requested steering angle (at wheels) of vehicle with given id [rad].
|
inline |
Get steering speed at front wheels of vehicle with given id [rad/s].
|
inline |
Check if driver-requested longitudinal acceleration has been set.
|
inline |
Check if driver-requested steering_angle has been set.
|
inlineoverridevirtual |
Reset the codec.
Discard received messages, clear data members, and implement sensor-specific reset steps.
Reimplemented from vtd::VtdOmniSensor.
|
inline |
Send the packed RDB message to the task control server.