|
bitsim
Model, simulate, estimate and control robots in C++
|
Classes | |
| struct | LineReading |
| struct | Segment |
| struct | Path |
| struct | Start |
| struct | Command |
| class | LineFollower |
| class | SquarePathDriver |
| class | World |
| class | Display |
| struct | Options |
| class | 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... | |
| class | DownwardCamera |
| A camera on a robot that looks straight down at the floor ahead. More... | |
| class | FloorImage |
| An image of the floor, centred on the world origin. More... | |
| struct | CameraFrame |
| A frame delivered by a camera backend. More... | |
| class | MJPEG_HTTPCameraBackend |
| Receives the frames of an MJPEG stream over HTTP, the multipart/x-mixed-replace response that many cameras and camera servers give, for example example 31's FastAPI server on a Raspberry Pi. More... | |
Typedefs | |
| using | Point = std::array<real_t, 2> |
| using | real_t |
| real_t | |
| using | uint_t |
| uint_t | |
Functions | |
| cv::Mat | to_gray (const cv::Mat &image) |
| cv::Mat | dark_pixels (const cv::Mat &gray) |
| LineReading | read_line (const cv::Mat &view, const DownwardCamera &camera) |
| std::optional< Path > | find_square (const FloorImage &floor) |
| std::optional< std::pair< Segment, real_t > > | find_segment (const FloorImage &floor) |
| real_t | nearest_side_heading (const Path &path, const Point &p) |
| Start | start_on_square (const Path &square) |
| Segment | counterclockwise (const Segment &side, const Point ¢re) |
| Start | start_on_side (const Segment &side) |
| Options | parse (int argc, char **argv) |
| std::optional< std::pair< Segment, real_t > > | wait_for_next_side (const MJPEG_HTTPCameraBackend &stream, real_t floor_width, real_t timeout) |
| int | run (const Options &options) |
| real_t | milliseconds_since (WallClock::time_point t) |
| The milliseconds since a time point. | |
Variables | |
| const std::string | DEFAULT_SERVER = "http://alex-rpi-5.local:8000" |
| const std::string | SQUARE_PATH_ENDPOINT = "/odysseus/camera/square-path" |
| const std::string | CAMERA_ENDPOINT = "/odysseus/camera" |
| const std::string | ROBOT_FILE = bitsim::consts::ROBOTS_DIR + "/bitsim_diff_drive_robot.json" |
| const std::string | WINDOW_TITLE = "A line following robot with a Raspberry Pi camera" |
| const real_t | PI = bitsim::consts::maths::PI |
| const real_t | STEP_SIZE = 0.01 |
| const real_t | DEFAULT_FLOOR_WIDTH = 3.0 |
| const real_t | TIME_LIMIT = 120.0 |
| const real_t | PRINT_PERIOD = 1.0 |
| const real_t | CRUISE_SPEED = 0.25 |
| const real_t | MIN_SPEED_RATIO = 0.3 |
| const real_t | MAX_TURN_RATE = 1.5 |
| const real_t | SEARCH_TURN_RATE = 0.6 |
| const real_t | LOST_TIME = 5.0 |
| const real_t | WAIT_TIME = 15.0 |
| const real_t | MIN_LINE_COVERAGE = 0.01 |
| const real_t | SQUARE_PATH_SPEED = 0.35 |
| const real_t | CORNER_TURN_RATE = 1.5 |
| const real_t | STOP_GAIN = 2.0 |
| const real_t | DARK_RATIO = 0.6 |
| using pi_camera_line_following::Point = std::array<real_t, 2> |
| using bitsim::real_t |
| using bitsim::uint_t |
| cv::Mat pi_camera_line_following::dark_pixels | ( | const cv::Mat & | gray | ) |
| std::optional< std::pair< Segment, real_t > > pi_camera_line_following::find_segment | ( | const FloorImage & | floor | ) |
| std::optional< Path > pi_camera_line_following::find_square | ( | const FloorImage & | floor | ) |
|
inline |
The milliseconds since a time point.
| Options pi_camera_line_following::parse | ( | int | argc, |
| char ** | argv ) |
| LineReading pi_camera_line_following::read_line | ( | const cv::Mat & | view, |
| const DownwardCamera & | camera ) |
| int pi_camera_line_following::run | ( | const Options & | options | ) |
| cv::Mat pi_camera_line_following::to_gray | ( | const cv::Mat & | image | ) |
| std::optional< std::pair< Segment, real_t > > pi_camera_line_following::wait_for_next_side | ( | const MJPEG_HTTPCameraBackend & | stream, |
| real_t | floor_width, | ||
| real_t | timeout ) |
| const std::string pi_camera_line_following::CAMERA_ENDPOINT = "/odysseus/camera" |
| const real_t pi_camera_line_following::CORNER_TURN_RATE = 1.5 |
| const real_t pi_camera_line_following::CRUISE_SPEED = 0.25 |
| const real_t pi_camera_line_following::DARK_RATIO = 0.6 |
| const real_t pi_camera_line_following::DEFAULT_FLOOR_WIDTH = 3.0 |
| const std::string pi_camera_line_following::DEFAULT_SERVER = "http://alex-rpi-5.local:8000" |
| const real_t pi_camera_line_following::LOST_TIME = 5.0 |
| const real_t pi_camera_line_following::MAX_TURN_RATE = 1.5 |
| const real_t pi_camera_line_following::MIN_LINE_COVERAGE = 0.01 |
| const real_t pi_camera_line_following::MIN_SPEED_RATIO = 0.3 |
| const real_t pi_camera_line_following::PI = bitsim::consts::maths::PI |
| const real_t pi_camera_line_following::PRINT_PERIOD = 1.0 |
| const std::string pi_camera_line_following::ROBOT_FILE = bitsim::consts::ROBOTS_DIR + "/bitsim_diff_drive_robot.json" |
| const real_t pi_camera_line_following::SEARCH_TURN_RATE = 0.6 |
| const std::string pi_camera_line_following::SQUARE_PATH_ENDPOINT = "/odysseus/camera/square-path" |
| const real_t pi_camera_line_following::SQUARE_PATH_SPEED = 0.35 |
| const real_t pi_camera_line_following::STEP_SIZE = 0.01 |
| const real_t pi_camera_line_following::STOP_GAIN = 2.0 |
| const real_t pi_camera_line_following::TIME_LIMIT = 120.0 |
| const real_t pi_camera_line_following::WAIT_TIME = 15.0 |
| const std::string pi_camera_line_following::WINDOW_TITLE = "A line following robot with a Raspberry Pi camera" |