|
bitsim
Model, simulate, estimate and control robots in C++
|
bitsim is a C++20 library to model, simulate, estimate and control robots: from the maths of frames, rotations and kinematics, through trajectories, mapping and motion planning, sensors and actuators, to a robot that drives in a Project Chrono world, or on the floor with real motors and a real camera. The source is on GitHub.
Reinforcement learning is in bitrl, which builds on bitsim and is documented here too.
|
|
|---|---|
| A differential drive robot in Chrono follows a line with its infrared elements, and drives around the boxes its ultrasonic sensor hears. Example | An extended Kalman filter fuses the encoders, the IMU, the infrared elements, the camera and two sonars: odometry (magenta) drifts, the filter (cyan) stays on the true path (yellow). Example |
|
|
| Hardware in the loop: the simulated robot follows the line with the frames of a real camera on a Raspberry Pi, streamed over HTTP. Example | A quadrotor flown from the laptop's keyboard with RC stick commands, through an angle mode flight controller. Example |
|
|
| A three joint arm in Chrono moves its tip along a straight line, with the joint angles from inverse kinematics at every step. Example | A rapidly exploring random tree plans across a warehouse; its path is shortened and compared with A* on an occupancy grid. Example |
|
|
| Grid planners side by side on one warehouse: breadth-first search, Dijkstra, A* and, here, Theta*, whose path leaves the grid and cuts across at any angle. Example | EKF-SLAM maps the posts of a warehouse from range and bearing sightings while working out where the robot is: dead reckoning (red) drifts through the wall, SLAM (blue) stays on the true path (green). Example |
|
|---|
| A fixed wing aircraft with a 6-DOF aerodynamic model takes off, flies a circuit of waypoints under an autopilot designed from its linearised dynamics, and lands with a flare and braking. Example |
| Area | What bitsim has |
|---|---|
| Geometry and maths | points, lines, frames, rotation matrices and Euler angles, probability distributions, a quadratic programming solver |
| Kinematics | planar and spatial arms with Denavit-Hartenberg parameters, forward and inverse kinematics, the kinematics of a differential drive |
| Trajectories | point to point motion with time scaling, waypoint trajectories |
| Motion planning | on occupancy grids breadth-first search, Dijkstra, A* and any-angle Theta*; rapidly exploring random trees; a world of box obstacles that both kinds of planner share. See Maps |
| Mapping | occupancy grids built from range scans, each cell the probability that it is occupied; landmark maps built with EKF-SLAM, with landmark ids or by data association on the Mahalanobis distance. See Maps |
| Dynamics | differential drive and bicycle models, a cart-pole, a quadrotor, a fixed wing aircraft |
| Sensors | ultrasonic, infrared and IMU sensors, a downward camera, a camera stream; simulated, or real over MQTT. See Sensors |
| Actuators | DC gear motors with encoders, brushless DC motors; simulated, or real on a board. See Actuators |
| Robots | a differential drive robot in Chrono, built from a robot file, and the vehicle models. See Robots |
| Estimation | Kalman and extended Kalman filters, wheel odometry, sensor fusion, EKF-SLAM |
| Control | PID controllers, LQR (discrete and continuous Riccati equations), model predictive control with bounds on the inputs and the states, line following, a quadrotor flight controller, a fixed wing autopilot. LQR and MPC examples: a cart-pole, a quadrotor, a differential drive robot, a fixed wing aircraft |
| Simulation | rigid bodies and robots in Project Chrono, drawn with Irrlicht |
| Hardware in the loop | Arduino boards over USB and Wi-Fi, MQTT sensors and motors, a Raspberry Pi camera |
| Parallel computing | a thread pool, parallel loops, seeds per task, a queue between threads; distributed simulation over MQTT, in lockstep or keeping pace with real robots; co-simulation of coupled subsystems. See Parallel and distributed computing |
bitrl is a library for reinforcement learning, built on bitsim: environments, from grid worlds to Gymnasium's and robots in Chrono, and the algorithms that learn in them, from dynamic programming to proximal policy optimization, with libtorch for the deep methods. Its pages are under bitrl in the menu: what it is, how to install it and its examples.