Go to the documentation of this file.
22 #if MRPT_HAS_INTERSENSE
23 #include "isense/isense.h"
27 #define isense_handles (static_cast<ISD_TRACKER_HANDLE*>(m_handles_ptr))
31 #if MRPT_HAS_INTERSENSE
35 #pragma comment(lib, "isense.dll")
38 #endif // MRPT_HAS_INTERSENSE
43 CIMUIntersense::CIMUIntersense()
44 : m_handles_ptr(nullptr),
57 #if MRPT_HAS_INTERSENSE
59 new ISD_TRACKER_HANDLE[ISD_MAX_TRACKERS]();
62 "MRPT has been compiled with 'BUILD_INTERSENSE'=OFF, so this class "
72 #if MRPT_HAS_INTERSENSE
84 #if MRPT_HAS_INTERSENSE
87 std::this_thread::sleep_for(200ms);
99 ISD_TRACKING_DATA_TYPE
data;
102 if (!res_ok)
continue;
107 float nowUI =
data.Station[0].TimeStamp;
113 obs->dataIsPresent[
IMU_YAW] =
true;
117 obs->dataIsPresent[
IMU_ROLL] =
true;
121 data.Station[0].AngularVelBodyFrame[0];
124 data.Station[0].AngularVelBodyFrame[1];
127 data.Station[0].AngularVelBodyFrame[2];
132 data.Station[0].AngularVelNavFrame[0];
135 data.Station[0].AngularVelNavFrame[1];
138 data.Station[0].AngularVelNavFrame[2];
143 data.Station[0].VelocityNavFrame[0];
146 data.Station[0].VelocityNavFrame[1];
149 data.Station[0].VelocityNavFrame[2];
154 data.Station[0].AccelNavFrame[0];
157 data.Station[0].AccelNavFrame[1];
160 data.Station[0].AccelNavFrame[2];
164 obs->rawMeasurements[
IMU_X_ACC] =
data.Station[0].AccelBodyFrame[0];
166 obs->rawMeasurements[
IMU_Y_ACC] =
data.Station[0].AccelBodyFrame[1];
168 obs->rawMeasurements[
IMU_Z_ACC] =
data.Station[0].AccelBodyFrame[2];
221 "MRPT has been compiled with 'BUILD_INTERSENSE'=OFF, so this class "
231 #if MRPT_HAS_INTERSENSE
233 DWORD openSuccess =
FALSE;
234 cout <<
"Opening trackers... ";
238 cout <<
"ERROR" << endl;
241 cout <<
"DONE" << endl;
243 WORD numOpenTrackers = 0;
244 ISD_NumOpenTrackers(&numOpenTrackers);
245 cout <<
"Number of opened trackers: " << numOpenTrackers << endl;
246 vector<ISD_STATION_INFO_TYPE> station_info(numOpenTrackers);
247 for (
int i = 0; i < ISD_MAX_TRACKERS; ++i)
251 cout <<
"Retrieving configuration from sensor " << i <<
"...";
254 Bool res_ok = ISD_GetStationConfig(
261 cout <<
" ERROR" << endl;
262 cout <<
"Sensor " << i
263 <<
" is working with default configuration!" << endl;
267 cout <<
" DONE" << endl;
278 station_info[i].TimeStamped =
281 cout <<
"Setting configuration to sensor " << i <<
"...";
283 res_ok = ISD_SetStationConfig(
288 res_ok ? cout <<
" DONE" << endl : cout <<
" ERROR" << endl;
290 #if 0 // set ring buffer to avoid data loss and start it:
292 if( station_info[i].State == 1 )
302 std::this_thread::sleep_for(500ms);
308 cout <<
"Found (and opened) " <<
m_nSensors <<
" sensors." << endl;
313 "MRPT has been compiled with 'BUILD_INTERSENSE'=OFF, so this class "
326 configSource.
read_float(iniSection,
"pose_x", 0,
false),
327 configSource.
read_float(iniSection,
"pose_y", 0,
false),
328 configSource.
read_float(iniSection,
"pose_z", 0,
false),
343 cout <<
"---------------------------" << endl;
344 cout <<
"Intersense IMU parameters: " << endl;
345 cout <<
"---------------------------" << endl;
351 cout <<
"---------------------------" << endl << endl;
@ IMU_YAW_VEL_GLOBAL
yaw angular velocity (global/navigation frame) (rad/sec)
@ IMU_X_ACC_GLOBAL
x-axis acceleration (global/navigation frame) (m/sec2)
mrpt::system::TTimeStamp secondsToTimestamp(const double nSeconds)
Transform a time interval (in seconds) into TTimeStamp (e.g.
@ IMU_Z_VEL
z-axis velocity (global/navigation frame) (m/sec)
@ IMU_PITCH
orientation pitch absolute value (global/navigation frame) (rad)
std::string std::string to_string(T v)
Just like std::to_string(), but with an overloaded version for std::string arguments.
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...
mrpt::poses::CPose3D m_sensorPose
A class for interfacing Intersense Inertial Measuring Units (IMUs).
@ IMU_ROLL_VEL
roll angular velocity (local/vehicle frame) (rad/sec)
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
@ IMU_ROLL
orientation roll absolute value (global/navigation frame) (rad)
bool read_bool(const std::string §ion, const std::string &name, bool defaultValue, bool failIfNotFound=false) const
Contains classes for various device interfaces.
#define THROW_EXCEPTION(msg)
#define ASSERT_(f)
Defines an assertion mechanism.
This namespace contains representation of robot actions and observations.
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
int read_int(const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const
GLsizei GLsizei GLenum GLenum const GLvoid * data
virtual ~CIMUIntersense()
Destructor.
@ IMU_PITCH_VEL
pitch angular velocity (local/vehicle frame) (rad/sec)
@ IMU_Y_VEL
y-axis velocity (global/navigation frame) (m/sec)
This class allows loading and storing values and vectors of different types from a configuration text...
@ IMU_Z_ACC
z-axis acceleration (local/vehicle frame) (m/sec2)
std::shared_ptr< CObservationIMU > Ptr
void initialize()
Turns on the iSense device and configure it for getting orientation data.
void appendObservation(const mrpt::serialization::CSerializable::Ptr &obj)
Like appendObservations() but for just one observation.
@ IMU_Z_ACC_GLOBAL
z-axis acceleration (global/navigation frame) (m/sec2)
@ IMU_X_ACC
x-axis acceleration (local/vehicle frame) (m/sec2)
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
std::string m_sensorLabel
See CGenericSensor.
float read_float(const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const
#define IMPLEMENTS_GENERIC_SENSOR(class_name, NameSpace)
This must be inserted in all CGenericSensor classes implementation files:
@ IMU_Y_ACC
y-axis acceleration (local/vehicle frame) (m/sec2)
@ IMU_PITCH_VEL_GLOBAL
pitch angular velocity (global/navigation frame) (rad/sec)
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
@ IMU_YAW
orientation yaw absolute value (global/navigation frame) (rad)
uint32_t m_timeStartUI
Timestamp management.
@ IMU_ROLL_VEL_GLOBAL
roll angular velocity (global/navigation frame) (rad/sec)
GLsizei const GLchar ** string
unsigned int m_toutCounter
Timeout counter (for internal use only)
mrpt::system::TTimeStamp m_timeStartTT
@ IMU_YAW_VEL
yaw angular velocity (local/vehicle frame) (rad/sec)
@ IMU_Y_ACC_GLOBAL
y-axis acceleration (global/navigation frame) (m/sec2)
void * m_handles_ptr
Opaque pointer to specifid iSense IMU structure.
@ IMU_X_VEL
x-axis velocity (global/navigation frame) (m/sec)
double DEG2RAD(const double x)
Degrees to radians.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |