A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial communication (product SN : 02-1222-01).
It uses a serial port connection to the device. The class implements the generic sensor class. See also the application "rawlog-grabber" for a ready-to-use application to gather data from the scanner. The generated observation is a CObservationIMU, but only the yaw angular velocity and the absolute yaw position are are set in the vector CObservationIMU::rawMeasurements. The sensor process rate is imposed by hardware at 100Hz. For now, this sensor is only supported on posix system.
PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
-------------------------------------------------------
[supplied_section_name]
process_rate = 100 ; MUST be 100 Hz.
pose_x=0 ; Sensor 3D position relative to the robot (meters)
pose_y=0
pose_z=0
pose_yaw=0 ; Angles in degrees
pose_pitch=0
pose_roll=0
sensorLabel = <label> ; Label of the sensor
COM_port_LIN = /dev/ttyUSB0 ; COM PORT in LINUX
operatingMode = <"rate"/"integrated", "incremental"> ; Default mode is Rate.
In most of the communs applications, this class will be used as :
CGyroKVHDSP3000 kvh; /// ... CConfigFile conf("conf.ini"); /// ... kvh.loadConfig_sensorSpecific(conf, "KVH"); /// ... while(1) { kvh.doProcess(); TListObservations rateObs; kvh.getObservations(rateObs); // ....
Definition at line 81 of file CGyroKVHDSP3000.h.
#include <mrpt/hwdrivers/CGyroKVHDSP3000.h>
Public Member Functions | |||
CGyroKVHDSP3000 () | |||
Constructor. | |||
void | loadConfig_sensorSpecific (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::CGyroKVHDSP3000 for the possible parameters. | |||
virtual | ~CGyroKVHDSP3000 () | ||
Destructor. | |||
void | doProcess () | ||
This method will be invoked at a minimum rate of "process_rate" (Hz)
| |||
void | initialize () | ||
Turns on the KVH DSP 3000 device and configure it for getting orientation data. | |||
void | resetIncrementalAngle (void) | ||
Send to the sensor the command 'Z' wich reset the integrated angle. | |||
void | changeMode (GYRO_MODE _newMode) | ||
Protected Member Functions | |||
bool | searchPortAndConnect () | ||
Search the port where the sensor is located and connect to it. | |||
Protected Attributes | |||
int | m_COMbauds | ||
This serial port will be attempted to be opened automatically when this class is first used to request data from the device. | |||
std::string | m_com_port | ||
mrpt::poses::CPose3D | m_sensorPose | ||
CSerialPort * | m_serialPort | ||
The serial port connection. | |||
GYRO_MODE | m_mode | ||
bool | m_firstInteration | ||
mrpt::slam::CObservationIMUPtr | m_observationGyro |
mrpt::hwdrivers::CGyroKVHDSP3000::CGyroKVHDSP3000 | ( | ) |
Constructor.
virtual mrpt::hwdrivers::CGyroKVHDSP3000::~CGyroKVHDSP3000 | ( | ) | [virtual] |
Destructor.
void mrpt::hwdrivers::CGyroKVHDSP3000::changeMode | ( | GYRO_MODE | _newMode | ) |
void mrpt::hwdrivers::CGyroKVHDSP3000::doProcess | ( | ) | [virtual] |
This method will be invoked at a minimum rate of "process_rate" (Hz)
This | method must throw an exception with a descriptive message if some critical error is found. |
Implements mrpt::hwdrivers::CGenericSensor.
void mrpt::hwdrivers::CGyroKVHDSP3000::initialize | ( | ) | [virtual] |
Turns on the KVH DSP 3000 device and configure it for getting orientation data.
you must have called loadConfig_sensorSpecific before calling this function.
Reimplemented from mrpt::hwdrivers::CGenericSensor.
void mrpt::hwdrivers::CGyroKVHDSP3000::loadConfig_sensorSpecific | ( | 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::CGyroKVHDSP3000 for the possible parameters.
Implements mrpt::hwdrivers::CGenericSensor.
void mrpt::hwdrivers::CGyroKVHDSP3000::resetIncrementalAngle | ( | void | ) |
Send to the sensor the command 'Z' wich reset the integrated angle.
(in both rate mode and incremental, this function has no effect)
bool mrpt::hwdrivers::CGyroKVHDSP3000::searchPortAndConnect | ( | ) | [protected] |
Search the port where the sensor is located and connect to it.
std::string mrpt::hwdrivers::CGyroKVHDSP3000::m_com_port [protected] |
Definition at line 90 of file CGyroKVHDSP3000.h.
int mrpt::hwdrivers::CGyroKVHDSP3000::m_COMbauds [protected] |
This serial port will be attempted to be opened automatically when this class is first used to request data from the device.
Definition at line 89 of file CGyroKVHDSP3000.h.
bool mrpt::hwdrivers::CGyroKVHDSP3000::m_firstInteration [protected] |
Definition at line 100 of file CGyroKVHDSP3000.h.
GYRO_MODE mrpt::hwdrivers::CGyroKVHDSP3000::m_mode [protected] |
Definition at line 99 of file CGyroKVHDSP3000.h.
Definition at line 102 of file CGyroKVHDSP3000.h.
Definition at line 92 of file CGyroKVHDSP3000.h.
The serial port connection.
Definition at line 98 of file CGyroKVHDSP3000.h.
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011 |