bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
real_dc_motors.cpp File Reference
#include "bitsim/bitsim_config.h"
#include "bitsim/actuators/backends/mqtt_dc_motor_backend.h"
#include "bitsim/actuators/backends/sim_dc_motor_backend.h"
#include "bitsim/actuators/dc_motor.h"
#include "bitsim/bitsim_consts.h"
#include "bitsim/bitsim_types.h"
#include "bitsim/boards/arduino/dc_arduino_board_impl.h"
#include "bitsim/extern/nlohmann/json/json.hpp"
#include "bitsim/maths/math_utils.h"
#include "bitsim/network/mqtt_publisher.h"
#include "bitsim/network/mqtt_subscriber.h"
#include "bitsim/rigid_bodies/chrono_robots/diff_drive_robot.h"
#include "bitsim/utils/io/print_utils.h"
#include "bitsim/utils/timing.h"
#include <chrono/physics/ChBodyEasy.h>
#include <chrono/physics/ChContactMaterialNSC.h>
#include <chrono/physics/ChSystemNSC.h>
#include "bitsim/utils/render/irrlicht_utils.h"
#include <chrono_irrlicht/ChIrrTools.h>
#include <chrono_irrlicht/ChVisualSystemIrrlicht.h>
#include <algorithm>
#include <array>
#include <chrono>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
Include dependency graph for real_dc_motors.cpp:

Classes

struct  real_dc_motors::Segment
class  real_dc_motors::Odometry
class  real_dc_motors::World
class  real_dc_motors::DCMotor
 A DC motor with an encoder, run in speed control. The application sets the target speed of the output shaft and reads back its angle and speed. The backend decides what the motor is: More...
class  real_dc_motors::DCArduinoBoardImpl
 An Arduino that drives DC motors with encoders and talks over MQTT. More...
class  real_dc_motors::CHRONO_DiffDriveRobot
 A differential-drive robot in Chrono: a chassis, two driven wheels and a ball caster. Each driven wheel has an actuators::DCMotor. More...

Namespaces

namespace  real_dc_motors

Typedefs

using real_dc_motors::Clock = bitsim::utils::WallClock
using real_dc_motors::real_t
 real_t
using real_dc_motors::uint_t
 uint_t

Functions

std::vector< Segment > real_dc_motors::square_plan ()
real_t real_dc_motors::plan_duration (const std::vector< Segment > &plan)
const Segment & real_dc_motors::segment_at (const std::vector< Segment > &plan, real_t t, bool repeat)
nlohmann::json real_dc_motors::read_robot_file ()
real_t real_dc_motors::robot_wheel_radius ()
bitsim::actuators::backends::DCMotorParameters real_dc_motors::robot_motor_parameters ()
void real_dc_motors::run_fake_board (const std::string &broker)
std::shared_ptr< DCArduinoBoardImpl > real_dc_motors::connect_board (const std::string &broker)
void real_dc_motors::print_row (const World &world, const Segment &segment)
void real_dc_motors::print_pose (const std::string &label, real_t x, real_t y, real_t theta)
void real_dc_motors::run (std::shared_ptr< DCArduinoBoardImpl > board)
void real_dc_motors::draw_path (chrono::irrlicht::ChVisualSystemIrrlicht &vis, const std::vector< ChVector3d > &path, const chrono::ChColor &color, real_t width)
void real_dc_motors::render (std::shared_ptr< DCArduinoBoardImpl > board)
int main (int argc, char **argv)
real_t real_dc_motors::seconds_between (WallClock::time_point from, WallClock::time_point to)
 The seconds from one time point to another.
real_t real_dc_motors::clean (real_t x, real_t zero=5.0e-4)
 x, or 0 when \(|x| <\) zero

Variables

const real_t real_dc_motors::PI = bitsim::consts::maths::PI
const real_t real_dc_motors::DEG = PI / 180.0
const real_t real_dc_motors::STEP_SIZE = 0.01
const std::string real_dc_motors::ROBOT_FILE = bitsim::consts::ROBOTS_DIR + "/bitsim_diff_drive_robot.json"
const std::string real_dc_motors::COMMAND_TOPIC = "bitsim/dc_board/command"
const std::string real_dc_motors::STATE_TOPIC = "bitsim/dc_board/state"
const real_t real_dc_motors::NETWORK_PERIOD = 0.02
const real_t real_dc_motors::OBSERVER_BANDWIDTH = 10.0

Function Documentation

◆ main()

int main ( int argc,
char ** argv )