Class CGyroKVHDSP3000
Defined in File CGyroKVHDSP3000.h
Inheritance Relationships
Base Type
public mrpt::hwdrivers::CGenericSensor(Class CGenericSensor)
Class Documentation
-
class CGyroKVHDSP3000 : public mrpt::hwdrivers::CGenericSensor
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.
In most of the communs applications, this class will be used as :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.
CGyroKVHDSP3000 kvh; /// ... CConfigFile conf("conf.ini"); /// ... kvh.loadConfig_sensorSpecific(conf, "KVH"); /// ... while(1) { kvh.doProcess(); TListObservations rateObs; kvh.getObservations(rateObs); // ....
Public Functions
-
CGyroKVHDSP3000()
Constructor
-
virtual void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection) override
See the class documentation at the top for expected parameters
-
~CGyroKVHDSP3000() override
Destructor
-
virtual void doProcess() override
This method will be invoked at a minimum rate of “process_rate” (Hz)
- Throws:
This – method must throw an exception with a descriptive message if some critical error is found.
-
virtual void initialize() override
Turns on the KVH DSP 3000 device and configure it for getting orientation data. you must have called loadConfig_sensorSpecific before calling this function.
-
void resetIncrementalAngle()
Send to the sensor the command ‘Z’ which reset the integrated angle. (in both rate mode and incremental, this function has no effect)
Protected Attributes
-
int m_COMbauds = {38400}
This serial port will be attempted to be opened automatically when this class is first used to request data from the device.
See also
-
std::string m_com_port
-
std::unique_ptr<mrpt::comms::CSerialPort> m_serialPort
Search the port where the sensor is located and connect to it The serial port connection
-
bool m_firstInteration = {true}
-
mrpt::obs::CObservationIMU::Ptr m_observationGyro
-
CGyroKVHDSP3000()