#include <mrpt/hwdrivers/CActivMediaRobotBase.h>
Public Member Functions | |
void | initialize () |
Connects to the robot. | |
CActivMediaRobotBase () | |
Constructor. | |
virtual | ~CActivMediaRobotBase () |
Destructor: turns off communications. | |
void | loadConfig (const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection) |
Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes) See hwdrivers::CActivMediaRobotBase for the possible parameters. | |
void | setSerialPortConfig (const std::string &portName, int portBaudRate) |
Manually sets the serial port configuration. | |
void | doProcess () |
Collect odometry readings and put them in the "observations" queue: DO NOT call this normally, it's useful only for the application rawloggrabber. | |
void | changeOdometry (const mrpt::poses::CPose2D &newOdometry) |
Change the current robot odometry pose. | |
void | getOdometry (poses::CPose2D &out_odom) |
Get the current robot's odometry. | |
void | getOdometryFull (poses::CPose2D &out_odom, double &out_lin_vel, double &out_ang_vel, int64_t &out_left_encoder_ticks, int64_t &out_right_encoder_ticks) |
Get the current robot's odometry. | |
void | getOdometryIncrement (poses::CPose2D &out_incr_odom, double &out_lin_vel, double &out_ang_vel, int64_t &out_incr_left_encoder_ticks, int64_t &out_incr_right_encoder_ticks) |
Get the robot's odometry increment since the last call to this method (the first time the increments are always fixed to zero). | |
void | getSonarsReadings (bool &thereIsObservation, mrpt::slam::CObservationRange &obs) |
Get the readings from the sonars, only if the observations are new. | |
void | getBatteryCharge (double &out_batery_volts) |
Get the robot battery charge. | |
void | setVelocities (const double &lin_vel, const double &ang_vel) |
Set the robot linear and angular velocities. | |
Protected Member Functions | |
void | disconnectAndDisableMotors () |
void | connectAndEnableMotors () |
Protected Attributes | |
std::string | m_com_port |
The serial port name to use for communications (COM1, ttyS1,...). | |
int | m_robotBaud |
The bauds for ARIA communications to the robot. | |
bool | m_firstIncreOdometry |
Used in getOdometryIncrement. | |
bool | m_enableSonars |
void * | m_robot |
void * | m_sonarDev |
void * | m_simpleConnector |
The connection to the robot. |
There is implemented access to robot odometry, ticks counts, velocities, battery charge status, and sonar readings, as well as basic velocity control.
It is required to check MRPT_BUILD_ARIA in the cmake configuration to enable this class to work properly.
See also the application "RawLogGrabber" for a ready-to-use application to gather data from the robot base.
PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS: ------------------------------------------------------- [supplied_section_name] robotPort_WIN = COM1 robotPort_LIN = /dev/ttyS0 robotBaud = 115200 enableSonars = 0 ; 0:Disabled (default), 1: Enabled joystick_control = 0 ; 0:Disabled (default), 1: Enabled joystick_max_v = 0.3 ; Max joystick control speed (m/s) joystick_max_w_degps = 40 ; Max joystick control speed (deg/s) joystick_is_gamepad = 0 ; 0: Direct control of speeds, 1: Gamepad control speed *increments*, buttons = stop.
Definition at line 63 of file CActivMediaRobotBase.h.
mrpt::hwdrivers::CActivMediaRobotBase::CActivMediaRobotBase | ( | ) |
Constructor.
virtual mrpt::hwdrivers::CActivMediaRobotBase::~CActivMediaRobotBase | ( | ) | [virtual] |
Destructor: turns off communications.
void mrpt::hwdrivers::CActivMediaRobotBase::changeOdometry | ( | const mrpt::poses::CPose2D & | newOdometry | ) |
Change the current robot odometry pose.
void mrpt::hwdrivers::CActivMediaRobotBase::connectAndEnableMotors | ( | ) | [protected] |
void mrpt::hwdrivers::CActivMediaRobotBase::disconnectAndDisableMotors | ( | ) | [protected] |
void mrpt::hwdrivers::CActivMediaRobotBase::doProcess | ( | ) | [virtual] |
Collect odometry readings and put them in the "observations" queue: DO NOT call this normally, it's useful only for the application rawloggrabber.
Implements mrpt::hwdrivers::CGenericSensor.
void mrpt::hwdrivers::CActivMediaRobotBase::getBatteryCharge | ( | double & | out_batery_volts | ) |
Get the robot battery charge.
void mrpt::hwdrivers::CActivMediaRobotBase::getOdometry | ( | poses::CPose2D & | out_odom | ) |
Get the current robot's odometry.
out_odom | The odometry will be returned here. |
void mrpt::hwdrivers::CActivMediaRobotBase::getOdometryFull | ( | poses::CPose2D & | out_odom, | |
double & | out_lin_vel, | |||
double & | out_ang_vel, | |||
int64_t & | out_left_encoder_ticks, | |||
int64_t & | out_right_encoder_ticks | |||
) |
Get the current robot's odometry.
out_odom | The odometry will be returned here. | |
out_lin_vel | The linear speed, in m/s, positive is forward. | |
out_ang_vel | The angular speed, in rad/s, positive is anticlockwise. | |
out_left_encoder_ticks | The current overall count of ticks for the left wheel encoder. | |
out_right_encoder_ticks | The current overall count of ticks for the right wheel encoder. |
void mrpt::hwdrivers::CActivMediaRobotBase::getOdometryIncrement | ( | poses::CPose2D & | out_incr_odom, | |
double & | out_lin_vel, | |||
double & | out_ang_vel, | |||
int64_t & | out_incr_left_encoder_ticks, | |||
int64_t & | out_incr_right_encoder_ticks | |||
) |
Get the robot's odometry increment since the last call to this method (the first time the increments are always fixed to zero).
out_odom | The odometry increment. | |
out_lin_vel | The current linear speed, in m/s, positive is forward (Absolute values, not increments) | |
out_ang_vel | The angular speed, in rad/s, positive is anticlockwise (Absolute values, not increments). | |
out_left_encoder_ticks | The increment in ticks for the left wheel encoder. | |
out_right_encoder_ticks | The increment in ticks for the right wheel encoder. |
void mrpt::hwdrivers::CActivMediaRobotBase::getSonarsReadings | ( | bool & | thereIsObservation, | |
mrpt::slam::CObservationRange & | obs | |||
) |
Get the readings from the sonars, only if the observations are new.
void mrpt::hwdrivers::CActivMediaRobotBase::initialize | ( | ) | [virtual] |
void mrpt::hwdrivers::CActivMediaRobotBase::loadConfig | ( | const mrpt::utils::CConfigFileBase & | configSource, | |
const std::string & | iniSection | |||
) | [virtual] |
Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes) See hwdrivers::CActivMediaRobotBase for the possible parameters.
Implements mrpt::hwdrivers::CGenericSensor.
void mrpt::hwdrivers::CActivMediaRobotBase::setSerialPortConfig | ( | const std::string & | portName, | |
int | portBaudRate | |||
) |
Manually sets the serial port configuration.
portName | Examples: Windows: "COM1" , Linux: "/dev/ttyUSB0" | |
portBaudRate | 9600, 115200, etc.. |
void mrpt::hwdrivers::CActivMediaRobotBase::setVelocities | ( | const double & | lin_vel, | |
const double & | ang_vel | |||
) |
Set the robot linear and angular velocities.
lin_vel | Linear speed, in m/s. | |
ang_vel | Angular speed, in rad/s. |
std::string mrpt::hwdrivers::CActivMediaRobotBase::m_com_port [protected] |
The serial port name to use for communications (COM1, ttyS1,...).
Definition at line 155 of file CActivMediaRobotBase.h.
bool mrpt::hwdrivers::CActivMediaRobotBase::m_enableSonars [protected] |
Definition at line 159 of file CActivMediaRobotBase.h.
bool mrpt::hwdrivers::CActivMediaRobotBase::m_firstIncreOdometry [protected] |
void* mrpt::hwdrivers::CActivMediaRobotBase::m_robot [protected] |
Definition at line 161 of file CActivMediaRobotBase.h.
int mrpt::hwdrivers::CActivMediaRobotBase::m_robotBaud [protected] |
The bauds for ARIA communications to the robot.
Definition at line 156 of file CActivMediaRobotBase.h.
void* mrpt::hwdrivers::CActivMediaRobotBase::m_simpleConnector [protected] |
void* mrpt::hwdrivers::CActivMediaRobotBase::m_sonarDev [protected] |
Definition at line 162 of file CActivMediaRobotBase.h.
Page generated by Doxygen 1.5.9 for MRPT 0.6.5 SVN: at Sun Aug 2 11:39:56 CDT 2009 |