|
bitsim
Model, simulate, estimate and control robots in C++
|
#include <diff_drive_robot.h>
Public Member Functions | |
| RobotSensorManager () | |
| template<typename Archive> | |
| void | read (const Archive &arch, std::shared_ptr< chrono::ChBody > body) |
| template<> | |
| void | read (const json &j, std::shared_ptr< chrono::ChBody > body) |
| uint_t | n_sensors () const noexcept |
| void | add (std::shared_ptr< sensors::SensorBase > sensor) |
| Add a new sensor to manage. | |
| std::shared_ptr< sensors::SensorBase > | get (const std::string &name) const |
| std::shared_ptr< sensors::UltrasonicSensor > | front_sonar () const noexcept |
| std::shared_ptr< sensors::UltrasonicSensor > | rear_sonar () const noexcept |
| std::shared_ptr< sensors::InfraredSensor > | line_sensor () const noexcept |
| std::shared_ptr< sensors::IMUSensor > | imu () const noexcept |
Class to manage the sensors attached on this
Constructor
|
inline |
Add a new sensor to manage.
| sensor |
|
inlinenoexcept |
| std::shared_ptr< sensors::SensorBase > bitsim::rb::bitsim_chrono::CHRONO_DiffDriveRobot::RobotSensorManager::get | ( | const std::string & | name | ) | const |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| void bitsim::rb::bitsim_chrono::CHRONO_DiffDriveRobot::RobotSensorManager::read | ( | const Archive & | arch, |
| std::shared_ptr< chrono::ChBody > | body ) |
Load the sensors of the robot from the archive. It reads, if they are there and enabled:
Each has a backend: SIMULATION, or MQTT for a real sensor on a board. An MQTT backend reads its broker and topic from the file too; connect it before reading the sensor.
| Archive | The type of the archive, for example nlohmann::json |
| arch | The sensors section of the robot file |
| body | The body the sensors are attached to |
| void bitsim::rb::bitsim_chrono::CHRONO_DiffDriveRobot::RobotSensorManager::read | ( | const json & | j, |
| std::shared_ptr< chrono::ChBody > | body ) |
|
inlinenoexcept |