BoB robotics
The Brains on Board robotics library
BoBRobotics::AntWorld::AntAgent Class Reference

A simple agent with a position and a panoramic view of the current AntWorld. More...

#include <agent.h>

Inheritance diagram for BoBRobotics::AntWorld::AntAgent:
BoBRobotics::AntWorld::Camera BoBRobotics::Video::OpenGL BoBRobotics::Video::Input

Public Member Functions

 AntAgent (sf::Window &window, Renderer &renderer, const cv::Size &renderSize, meters_per_second_t velocity=DefaultVelocity, radians_per_second_t turnSpeed=DefaultTurnSpeed)
 
void moveForward (float speed)
 
void turnOnTheSpot (float clockwiseSpeed)
 
void stopMoving ()
 
void addJoystick (HID::Joystick &joystick, float deadZone=0.25f)
 
void drive (const HID::Joystick &joystick, float deadZone=0.25f)
 Drive the robot using the current joystick state.
 
radians_per_second_t getMaximumTurnSpeed () const
 
void setPosition (meter_t x, meter_t y, meter_t z)
 
void setAttitude (degree_t yaw, degree_t pitch, degree_t roll)
 
void updatePose (const units::time::second_t elapsedTime)
 
- Public Member Functions inherited from BoBRobotics::AntWorld::Camera
 Camera (sf::Window &window, Renderer &renderer, const cv::Size &renderSize)
 
void display ()
 
Pose3< meter_t, degree_tgetPose () const
 
sf::Window & getWindow () const
 
bool isOpen () const
 
void setPose (const Pose3< meter_t, degree_t > &pose)
 
void setPosition (meter_t x, meter_t y, meter_t z)
 
void setAttitude (degree_t yaw, degree_t pitch, degree_t roll)
 
virtual bool readFrame (cv::Mat &outFrame) override
 Try to read a frame in colour from this video source. More...
 
- Public Member Functions inherited from BoBRobotics::Video::OpenGL
 OpenGL (const cv::Size &size, const cv::Point &bottomLeft={ 0, 0 })
 Create a Video::Input for reading from an OpenGL window. More...
 
virtual std::string getCameraName () const override
 Get the name of this type of camera as a (short) string. More...
 
virtual cv::Size getOutputSize () const override
 Get the current output resolution of this video stream. More...
 
virtual bool readFrame (cv::Mat &outFrame) override
 Try to read a frame in colour from this video source. More...
 
virtual bool needsUnwrapping () const override
 Whether this video source needs unwrapping with an ImgProc::OpenCVUnwrap360. More...
 
- Public Member Functions inherited from BoBRobotics::Video::Input
ImgProc::OpenCVUnwrap360 createUnwrapper (const cv::Size &unwrapRes) const
 Create an ImgProc::OpenCVUnwrap360 object for this video stream. More...
 
virtual std::string getCameraName () const
 Get the name of this type of camera as a (short) string. More...
 
virtual units::frequency::hertz_t getFrameRate () const
 
virtual cv::Size getOutputSize () const =0
 Get the current output resolution of this video stream. More...
 
virtual bool needsUnwrapping () const
 Whether this video source needs unwrapping with an ImgProc::OpenCVUnwrap360. More...
 
virtual void setOutputSize (const cv::Size &)
 Set the output resolution of this video stream. More...
 
virtual bool readFrame (cv::Mat &outFrame)=0
 Try to read a frame in colour from this video source. More...
 
virtual bool readGreyscaleFrame (cv::Mat &outFrame)
 Try to read a frame in greyscale from this video source. More...
 
void readFrameSync (cv::Mat &outFrame)
 Read a frame synchronously, blocking until a new frame is received.
 
void readGreyscaleFrameSync (cv::Mat &outFrame)
 
void write (cv::FileStorage &fs) const
 Allows OpenCV to serialise info about this Input.
 

Static Public Attributes

static constexpr meters_per_second_t DefaultVelocity = 0.03_mps
 
static constexpr radians_per_second_t DefaultTurnSpeed = 200_deg_per_s
 
- Static Public Attributes inherited from BoBRobotics::Video::Input
static constexpr const char * DefaultCameraName = "unknown_camera"
 

Additional Inherited Members

- Static Public Member Functions inherited from BoBRobotics::AntWorld::Camera
static std::unique_ptr< sf::Window > initialiseWindow (const cv::Size &size)
 
- Protected Types inherited from BoBRobotics::AntWorld::Camera
using meter_t = units::length::meter_t
 
using degree_t = units::angle::degree_t
 

Detailed Description

A simple agent with a position and a panoramic view of the current AntWorld.


The documentation for this class was generated from the following files: