28 CGyroKVHDSP3000::CGyroKVHDSP3000()
33 m_firstInteration(true)
56 std::this_thread::sleep_for(200ms);
64 mrpt::make_aligned_shared<CObservationIMU>();
71 string delimiter(
" ");
74 if (words.size() < 2)
return;
75 if (words[1].c_str()[0] ==
'0')
return;
76 double mesure = atof(words[0].c_str());
86 observationGyro->dataIsPresent[
IMU_YAW] =
true;
128 configSource.
read_float(iniSection,
"pose_x", 0,
false),
129 configSource.
read_float(iniSection,
"pose_y", 0,
false),
130 configSource.
read_float(iniSection,
"pose_z", 0,
false),
134 string operatingMode =
135 configSource.
read_string(iniSection,
"operatingMode",
"rate",
false);
136 cout <<
"Operating mode : " << operatingMode << endl;
137 if (operatingMode ==
"incremental")
140 cout <<
"Incremental mode" << endl;
142 else if (operatingMode ==
"integral")
145 cout <<
"Integrated mode" << endl;
150 cout <<
"Rate mode" << endl;
#define IMPLEMENTS_GENERIC_SENSOR(class_name, NameSpace)
This must be inserted in all CGenericSensor classes implementation files:
A communications serial port built as an implementation of a utils::CStream.
bool isOpen() const
Returns if port has been correctly open.
void setConfig(int baudRate, int parity=0, int bits=8, int nStopBits=1, bool enableFlowControl=false)
Changes the configuration of the port.
std::string ReadString(const int total_timeout_ms=-1, bool *out_timeout=nullptr, const char *eol_chars="\r\n")
Reads one text line from the serial port in POSIX "canonical mode".
size_t Write(const void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for writing to the stream.
void close()
Close the port.
This class allows loading and storing values and vectors of different types from a configuration text...
std::string read_string(const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const
float read_float(const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const
void appendObservation(const mrpt::serialization::CSerializable::Ptr &obj)
Like appendObservations() but for just one observation.
double m_process_rate
See CGenericSensor.
std::string m_sensorLabel
See CGenericSensor.
A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial communication (product SN...
virtual ~CGyroKVHDSP3000()
Destructor.
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
void changeMode(GYRO_MODE _newMode)
void resetIncrementalAngle(void)
Send to the sensor the command 'Z' wich reset the integrated angle.
mrpt::comms::CSerialPort * m_serialPort
Search the port where the sensor is located and connect to it.
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
mrpt::poses::CPose3D m_sensorPose
void initialize()
Turns on the KVH DSP 3000 device and configure it for getting orientation data.
int m_COMbauds
This serial port will be attempted to be opened automatically when this class is first used to reques...
std::shared_ptr< CObservationIMU > Ptr
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...
#define THROW_EXCEPTION(msg)
GLsizei const GLchar ** string
@ IMU_YAW
orientation yaw absolute value (global/navigation frame) (rad)
@ IMU_YAW_VEL
yaw angular velocity (local/vehicle frame) (rad/sec)
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.
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
Serial and networking devices and utilities.
Contains classes for various device interfaces.
This namespace contains representation of robot actions and observations.
double DEG2RAD(const double x)
Degrees to radians.