bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
ekf_sensor_fusion Namespace Reference

Classes

class  Driver
class  World
class  Display
struct  Options
struct  Usage
struct  ErrorStats
class  InfraredLineFollower
 Follow a dark line with a row of infrared elements. More...
struct  Box2d
 An axis-aligned rectangle in the plane [m]: a wall or a box, seen from above. More...
class  DiffDriveEKF
 An extended Kalman filter that fuses everything a small differential drive robot senses: wheel encoders, a gyroscope, infrared elements and a camera that see a line on the floor, and ultrasonic range sensors. More...
class  DiffDriveMap
 What a robot knows about where it drives: the line on the floor, a RoundedRectangle, and the walls and boxes its range sensors can hear. More...
class  DiffDriveOdometry
 Dead reckoning for a differential drive robot from its wheel encoders. More...
class  GyroHeading
 The heading of a robot from its gyroscope: dead reckoning of the rate about the vertical. More...
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  ContactCounter
 Counts the contacts that touch any of a set of bodies, such as the obstacles a robot should not hit. More...
class  FloorImage
 An image of the floor, centred on the world origin. More...
class  IMUSensor
 An inertial measurement unit: a three axis accelerometer and a three axis gyroscope, along the axes of the body it is on. More...
class  InfraredSensor
 An array of infrared reflectance elements that looks at the floor, to tell its colour: light paper or a dark line. More...
class  UltrasonicSensor
 Class for modelling ultrasonic sensors. More...
class  RoundedRectangle
 A closed track in the plane: a rectangle centred on the origin with its sides along x and y, and its corners rounded with quarter circles. More...
class  FrameRecorder
 Writes the window to dir/frame_00000.png, frame_00001.png, ..., rate times a second of simulation, to be put together into a movie. With an empty dir it writes nothing. More...
class  InsetCamera
 A camera on a robot whose view is drawn in the top left corner of the window. It only shows the scene; mouse and keyboard still move the main camera. More...
class  Trail
 A path drawn as a line: in the plane, just above the floor, where a robot has been or where it thinks it has been; or in space, where something has flown. More...

Typedefs

using Command = bitsim::control::DiffDriveCommand
using Point = std::array<real_t, 2>
using real_t
 real_t
using uint_t
 uint_t

Functions

DiffDriveMap make_map ()
FloorImage draw_floor ()
std::string to_string (Driver::State state)
Options parse (int argc, char **argv)
int run (const Options &options)

Variables

const std::string ROBOT_FILE = bitsim::consts::ROBOTS_DIR + "/bitsim_diff_drive_robot.json"
const std::string WINDOW_TITLE = "Sensor fusion with an extended Kalman filter"
const real_t PI = bitsim::consts::maths::PI
const real_t STEP_SIZE = 0.01
const real_t TIME_LIMIT = 150.0
const real_t PRINT_PERIOD = 1.0
const real_t RENDER_RATE = 30.0
const real_t RECORD_RATE = 10.0
const real_t TRACK_HALF_LENGTH = 2.2
const real_t TRACK_HALF_WIDTH = 1.4
const real_t TRACK_CORNER_RADIUS = 0.7
const real_t LINE_WIDTH = 0.05
const real_t FLOOR_WIDTH = 5.6
const real_t FLOOR_HEIGHT = 4.6
const real_t METRES_PER_PIXEL = 0.005
const uchar PAPER = 235
const uchar INK = 25
const std::vector< Point > OBSTACLES {{0.0, -TRACK_HALF_WIDTH}, {-0.2, TRACK_HALF_WIDTH}}
const real_t OBSTACLE_SIZE = 0.3
const real_t OBSTACLE_HEIGHT = 0.4
const real_t ROOM_HALF_LENGTH = 3.0
const real_t ROOM_HALF_WIDTH = 2.5
const real_t WALL_THICKNESS = 0.1
const real_t WALL_HEIGHT = 0.5
const real_t IR_SIGMA = 0.02
const real_t CAMERA_SIGMA = 0.01
const Point START {-1.3, -TRACK_HALF_WIDTH}
const real_t CRUISE_SPEED = 0.3
const real_t LINE_TURN_RATE = 1.6
const real_t SEARCH_TURN_RATE = 0.8
const real_t LOST_TIME = 3.0
const real_t STOP_DISTANCE = 0.5
const real_t TURN_AWAY_ANGLE = 60.0 * PI / 180
const real_t DETOUR_RADIUS = 1.2
const real_t DETOUR_SPEED = 0.25
const real_t PIVOT_RATE = 1.0
const real_t CALIBRATION_TIME = 1.0
const real_t TRAIL_STEP = 0.02
const chrono::ChVector3d CAMERA_POSITION {0.26, 0.0, 0.07}
const real_t CAMERA_TILT = 8.0 * PI / 180
const real_t CAMERA_FOV = 60.0 * PI / 180
const int CAMERA_WIDTH = 384
const int CAMERA_HEIGHT = 216
const RoundedRectangle TRACK (TRACK_HALF_LENGTH, TRACK_HALF_WIDTH, TRACK_CORNER_RADIUS)
const InfraredLineFollower::Parameters FOLLOW_LINE

Typedef Documentation

◆ Command

◆ Point

using ekf_sensor_fusion::Point = std::array<real_t, 2>

◆ real_t

◆ uint_t

Function Documentation

◆ draw_floor()

FloorImage ekf_sensor_fusion::draw_floor ( )

◆ make_map()

DiffDriveMap ekf_sensor_fusion::make_map ( )

◆ parse()

Options ekf_sensor_fusion::parse ( int argc,
char ** argv )

◆ run()

int ekf_sensor_fusion::run ( const Options & options)

◆ to_string()

std::string ekf_sensor_fusion::to_string ( Driver::State state)

Variable Documentation

◆ CALIBRATION_TIME

const real_t ekf_sensor_fusion::CALIBRATION_TIME = 1.0

◆ CAMERA_FOV

const real_t ekf_sensor_fusion::CAMERA_FOV = 60.0 * PI / 180

◆ CAMERA_HEIGHT

const int ekf_sensor_fusion::CAMERA_HEIGHT = 216

◆ CAMERA_POSITION

const chrono::ChVector3d ekf_sensor_fusion::CAMERA_POSITION {0.26, 0.0, 0.07}

◆ CAMERA_SIGMA

const real_t ekf_sensor_fusion::CAMERA_SIGMA = 0.01

◆ CAMERA_TILT

const real_t ekf_sensor_fusion::CAMERA_TILT = 8.0 * PI / 180

◆ CAMERA_WIDTH

const int ekf_sensor_fusion::CAMERA_WIDTH = 384

◆ CRUISE_SPEED

const real_t ekf_sensor_fusion::CRUISE_SPEED = 0.3

◆ DETOUR_RADIUS

const real_t ekf_sensor_fusion::DETOUR_RADIUS = 1.2

◆ DETOUR_SPEED

const real_t ekf_sensor_fusion::DETOUR_SPEED = 0.25

◆ FLOOR_HEIGHT

const real_t ekf_sensor_fusion::FLOOR_HEIGHT = 4.6

◆ FLOOR_WIDTH

const real_t ekf_sensor_fusion::FLOOR_WIDTH = 5.6

◆ FOLLOW_LINE

const InfraredLineFollower::Parameters ekf_sensor_fusion::FOLLOW_LINE
Initial value:
const real_t SEARCH_TURN_RATE
Definition ekf_sensor_fusion.cpp:131
const real_t CRUISE_SPEED
Definition ekf_sensor_fusion.cpp:129
const real_t LOST_TIME
Definition ekf_sensor_fusion.cpp:132
const real_t LINE_TURN_RATE
Definition ekf_sensor_fusion.cpp:130

◆ INK

const uchar ekf_sensor_fusion::INK = 25

◆ IR_SIGMA

const real_t ekf_sensor_fusion::IR_SIGMA = 0.02

◆ LINE_TURN_RATE

const real_t ekf_sensor_fusion::LINE_TURN_RATE = 1.6

◆ LINE_WIDTH

const real_t ekf_sensor_fusion::LINE_WIDTH = 0.05

◆ LOST_TIME

const real_t ekf_sensor_fusion::LOST_TIME = 3.0

◆ METRES_PER_PIXEL

const real_t ekf_sensor_fusion::METRES_PER_PIXEL = 0.005

◆ OBSTACLE_HEIGHT

const real_t ekf_sensor_fusion::OBSTACLE_HEIGHT = 0.4

◆ OBSTACLE_SIZE

const real_t ekf_sensor_fusion::OBSTACLE_SIZE = 0.3

◆ OBSTACLES

const std::vector<Point> ekf_sensor_fusion::OBSTACLES {{0.0, -TRACK_HALF_WIDTH}, {-0.2, TRACK_HALF_WIDTH}}

◆ PAPER

const uchar ekf_sensor_fusion::PAPER = 235

◆ PI

const real_t ekf_sensor_fusion::PI = bitsim::consts::maths::PI

◆ PIVOT_RATE

const real_t ekf_sensor_fusion::PIVOT_RATE = 1.0

◆ PRINT_PERIOD

const real_t ekf_sensor_fusion::PRINT_PERIOD = 1.0

◆ RECORD_RATE

const real_t ekf_sensor_fusion::RECORD_RATE = 10.0

◆ RENDER_RATE

const real_t ekf_sensor_fusion::RENDER_RATE = 30.0

◆ ROBOT_FILE

const std::string ekf_sensor_fusion::ROBOT_FILE = bitsim::consts::ROBOTS_DIR + "/bitsim_diff_drive_robot.json"

◆ ROOM_HALF_LENGTH

const real_t ekf_sensor_fusion::ROOM_HALF_LENGTH = 3.0

◆ ROOM_HALF_WIDTH

const real_t ekf_sensor_fusion::ROOM_HALF_WIDTH = 2.5

◆ SEARCH_TURN_RATE

const real_t ekf_sensor_fusion::SEARCH_TURN_RATE = 0.8

◆ START

const Point ekf_sensor_fusion::START {-1.3, -TRACK_HALF_WIDTH}

◆ STEP_SIZE

const real_t ekf_sensor_fusion::STEP_SIZE = 0.01

◆ STOP_DISTANCE

const real_t ekf_sensor_fusion::STOP_DISTANCE = 0.5

◆ TIME_LIMIT

const real_t ekf_sensor_fusion::TIME_LIMIT = 150.0

◆ TRACK

◆ TRACK_CORNER_RADIUS

const real_t ekf_sensor_fusion::TRACK_CORNER_RADIUS = 0.7

◆ TRACK_HALF_LENGTH

const real_t ekf_sensor_fusion::TRACK_HALF_LENGTH = 2.2

◆ TRACK_HALF_WIDTH

const real_t ekf_sensor_fusion::TRACK_HALF_WIDTH = 1.4

◆ TRAIL_STEP

const real_t ekf_sensor_fusion::TRAIL_STEP = 0.02

◆ TURN_AWAY_ANGLE

const real_t ekf_sensor_fusion::TURN_AWAY_ANGLE = 60.0 * PI / 180

◆ WALL_HEIGHT

const real_t ekf_sensor_fusion::WALL_HEIGHT = 0.5

◆ WALL_THICKNESS

const real_t ekf_sensor_fusion::WALL_THICKNESS = 0.1

◆ WINDOW_TITLE

const std::string ekf_sensor_fusion::WINDOW_TITLE = "Sensor fusion with an extended Kalman filter"