|
bitsim
Model, simulate, estimate and control robots in C++
|
An image of the floor, centred on the world origin. More...
#include <downward_camera.h>
Public Member Functions | |
| FloorImage (const cv::Mat &image, real_t width) | |
| Constructor. | |
| void | write_texture (const std::string &path) const |
| Write the image as a colour PNG, for a texture: Irrlicht reads colour pictures more reliably than grey ones. Throws if the file cannot be written. | |
| const cv::Mat & | image () const noexcept |
| real_t | width () const noexcept |
| The width of the floor, along x [m]. | |
| real_t | height () const noexcept |
| The height of the floor, along y [m]. | |
| real_t | metres_per_pixel () const noexcept |
| The size of a pixel [m]. | |
| cv::Point2d | to_pixel (real_t x, real_t y) const |
| The pixel, with fractions, at the given point of the floor. | |
| std::array< real_t, 2 > | to_world (const cv::Point2d &pixel) const |
| The point of the floor at the given pixel, with fractions. | |
| real_t | reflectance (real_t x, real_t y) const |
| How bright the floor is at a point, from 0 for black to 1 for white: the brightness of the pixel there. Outside the image the floor is white. An infrared element looking at the floor reads this, see backends::CHRONO_InfraredBackend. | |
Static Public Member Functions | |
| static FloorImage | draw (real_t width, real_t height, real_t metres_per_pixel, const std::function< bool(real_t, real_t)> &is_ink, uchar paper=235, uchar ink=25) |
| Draw a floor: a grey picture of width x height metres of paper, with ink wherever is_ink(x, y) is true. | |
An image of the floor, centred on the world origin.
The image covers width() x height() metres of the floor. Its centre is at the origin, its columns grow with x and its rows grow against y, so the top of the image is the side of the floor with the largest y.
| bitsim::sensors::FloorImage::FloorImage | ( | const cv::Mat & | image, |
| real_t | width ) |
Constructor.
| image | The image of the floor |
| width | The width of the floor the image covers, along x [m] |
|
static |
Draw a floor: a grey picture of width x height metres of paper, with ink wherever is_ink(x, y) is true.
| width | The width of the floor, along x [m] |
| height | The height of the floor, along y [m] |
| metres_per_pixel | The size of a pixel [m] |
| is_ink | Whether the point (x, y) of the floor is inked |
| paper | The brightness of the paper, 0 to 255 |
| ink | The brightness of the ink |
|
inlinenoexcept |
The height of the floor, along y [m].
|
inlinenoexcept |
|
inlinenoexcept |
The size of a pixel [m].
| real_t bitsim::sensors::FloorImage::reflectance | ( | real_t | x, |
| real_t | y ) const |
How bright the floor is at a point, from 0 for black to 1 for white: the brightness of the pixel there. Outside the image the floor is white. An infrared element looking at the floor reads this, see backends::CHRONO_InfraredBackend.
| cv::Point2d bitsim::sensors::FloorImage::to_pixel | ( | real_t | x, |
| real_t | y ) const |
The pixel, with fractions, at the given point of the floor.
| std::array< real_t, 2 > bitsim::sensors::FloorImage::to_world | ( | const cv::Point2d & | pixel | ) | const |
The point of the floor at the given pixel, with fractions.
|
inlinenoexcept |
The width of the floor, along x [m].
| void bitsim::sensors::FloorImage::write_texture | ( | const std::string & | path | ) | const |
Write the image as a colour PNG, for a texture: Irrlicht reads colour pictures more reliably than grey ones. Throws if the file cannot be written.