28 CGyroKVHDSP3000::CGyroKVHDSP3000() : m_com_port(), m_sensorPose()
44 std::this_thread::sleep_for(200ms);
58 string delimiter(
" ");
61 if (words.size() < 2)
return;
62 if (words[1].c_str()[0] ==
'0')
return;
63 double mesure = atof(words[0].c_str());
73 observationGyro->dataIsPresent[
IMU_YAW] =
true;
111 const std::string& iniSection)
114 configSource.
read_float(iniSection,
"pose_x", 0,
false),
115 configSource.
read_float(iniSection,
"pose_y", 0,
false),
116 configSource.
read_float(iniSection,
"pose_z", 0,
false),
120 string operatingMode =
121 configSource.
read_string(iniSection,
"operatingMode",
"rate",
false);
122 cout <<
"Operating mode : " << operatingMode << endl;
123 if (operatingMode ==
"incremental")
126 cout <<
"Incremental mode" << endl;
128 else if (operatingMode ==
"integral")
131 cout <<
"Integrated mode" << endl;
136 cout <<
"Rate mode" << endl;
162 if (
m_serialPort->Write(commande, 3 *
sizeof(
char)) <= 0)
176 if (
m_serialPort->Write(commande, 3 *
sizeof(
char)) <= 0)
void initialize() override
Turns on the KVH DSP 3000 device and configure it for getting orientation data.
void resetIncrementalAngle()
Send to the sensor the command 'Z' wich reset the integrated angle.
double m_process_rate
See CGenericSensor.
void appendObservation(const mrpt::serialization::CSerializable::Ptr &obj)
Like appendObservations() but for just one observation.
std::string read_string(const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const
#define THROW_EXCEPTION(msg)
std::string m_sensorLabel
See CGenericSensor.
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
Contains classes for various device interfaces.
float read_float(const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const
void tokenize(const std::string &inString, const std::string &inDelimiters, OUT_CONTAINER &outTokens, bool skipBlankTokens=true) noexcept
Tokenizes a string according to a set of delimiting characters.
std::unique_ptr< mrpt::comms::CSerialPort > m_serialPort
Search the port where the sensor is located and connect to it.
This class allows loading and storing values and vectors of different types from a configuration text...
void doProcess() override
This method will be invoked at a minimum rate of "process_rate" (Hz)
constexpr double DEG2RAD(const double x)
Degrees to radians.
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection) override
See the class documentation at the top for expected parameters.
This namespace contains representation of robot actions and observations.
#define IMPLEMENTS_GENERIC_SENSOR(class_name, NameSpace)
This must be inserted in all CGenericSensor classes implementation files:
A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial communication (product SN...
mrpt::poses::CPose3D m_sensorPose
~CGyroKVHDSP3000() override
Destructor.
void setFromValues(const double x0, const double y0, const double z0, const double yaw=0, const double pitch=0, const double roll=0)
Set the pose from a 3D position (meters) and yaw/pitch/roll angles (radians) - This method recomputes...
orientation yaw absolute value (global/navigation frame) (rad)
Serial and networking devices and utilities.
yaw angular velocity (local/vehicle frame) (rad/sec)
void changeMode(GYRO_MODE _newMode)
int m_COMbauds
This serial port will be attempted to be opened automatically when this class is first used to reques...