23 #if MRPT_HAS_INTERSENSE
24 #include "isense/isense.h"
28 #define isense_handles (static_cast<ISD_TRACKER_HANDLE*>(m_handles_ptr))
32 #if MRPT_HAS_INTERSENSE
33 #ifdef MRPT_OS_WINDOWS
35 #if defined(_MSC_VER) || defined(__BORLANDC__)
36 #pragma comment (lib,"isense.dll")
44 CIMUIntersense::CIMUIntersense( ) :
58 #if MRPT_HAS_INTERSENSE
61 THROW_EXCEPTION(
"MRPT has been compiled with 'BUILD_INTERSENSE'=OFF, so this class cannot be used.");
71 #if MRPT_HAS_INTERSENSE
82 #if MRPT_HAS_INTERSENSE
98 ISD_TRACKING_DATA_TYPE
data;
106 float nowUI =
data.Station[0].TimeStamp;
108 CObservationIMUPtr obs = CObservationIMU::Create();
112 obs->dataIsPresent[
IMU_YAW] =
true;
116 obs->dataIsPresent[
IMU_ROLL] =
true;
119 obs->rawMeasurements[
IMU_YAW_VEL] =
data.Station[0].AngularVelBodyFrame[0];
123 obs->rawMeasurements[
IMU_ROLL_VEL] =
data.Station[0].AngularVelBodyFrame[2];
135 obs->rawMeasurements[
IMU_X_VEL] =
data.Station[0].VelocityNavFrame[0];
137 obs->rawMeasurements[
IMU_Y_VEL] =
data.Station[0].VelocityNavFrame[1];
139 obs->rawMeasurements[
IMU_Z_VEL] =
data.Station[0].VelocityNavFrame[2];
151 obs->rawMeasurements[
IMU_X_ACC] =
data.Station[0].AccelBodyFrame[0];
153 obs->rawMeasurements[
IMU_Y_ACC] =
data.Station[0].AccelBodyFrame[1];
155 obs->rawMeasurements[
IMU_Z_ACC] =
data.Station[0].AccelBodyFrame[2];
202 THROW_EXCEPTION(
"MRPT has been compiled with 'BUILD_INTERSENSE'=OFF, so this class cannot be used.");
211 #if MRPT_HAS_INTERSENSE
213 DWORD openSuccess =
FALSE;
214 cout <<
"Opening trackers... ";
216 if( openSuccess < 1 )
217 cout <<
"ERROR" << endl;
220 cout <<
"DONE" << endl;
222 WORD numOpenTrackers = 0;
223 ISD_NumOpenTrackers(&numOpenTrackers);
224 cout <<
"Number of opened trackers: " << numOpenTrackers << endl;
225 vector<ISD_STATION_INFO_TYPE> station_info(numOpenTrackers);
226 for(
int i = 0; i < ISD_MAX_TRACKERS; ++i)
230 cout <<
"Retrieving configuration from sensor " << i <<
"...";
233 Bool res_ok = ISD_GetStationConfig(
241 cout <<
" ERROR" << endl;
242 cout <<
"Sensor " << i <<
" is working with default configuration!" << endl;
246 cout <<
" DONE" << endl;
256 station_info[i].TimeStamped =
TRUE;
258 cout <<
"Setting configuration to sensor " << i <<
"...";
260 res_ok = ISD_SetStationConfig(
266 res_ok ? cout <<
" DONE" << endl : cout <<
" ERROR" << endl;
270 if( station_info[i].State == 1 )
286 cout <<
"Found (and opened) " <<
m_nSensors <<
" sensors." << endl;
290 THROW_EXCEPTION(
"MRPT has been compiled with 'BUILD_INTERSENSE'=OFF, so this class cannot be used.");
302 configSource.
read_float( iniSection,
"pose_x", 0,
false ),
303 configSource.
read_float( iniSection,
"pose_y", 0,
false ),
304 configSource.
read_float( iniSection,
"pose_z", 0,
false ),
316 cout <<
"---------------------------" << endl;
317 cout <<
"Intersense IMU parameters: " << endl;
318 cout <<
"---------------------------" << endl;
324 cout <<
"---------------------------" << endl << endl;
#define IMPLEMENTS_GENERIC_SENSOR(class_name, NameSpace)
This must be inserted in all CGenericSensor classes implementation files:
void appendObservation(const mrpt::utils::CSerializablePtr &obj)
Like appendObservations() but for just one observation.
std::string m_sensorLabel
See CGenericSensor.
A class for interfacing Intersense Inertial Measuring Units (IMUs).
mrpt::system::TTimeStamp m_timeStartTT
uint32_t m_timeStartUI
Timestamp management.
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
virtual ~CIMUIntersense()
Destructor.
void initialize()
Turns on the iSense device and configure it for getting orientation data.
void * m_handles_ptr
Opaque pointer to specifid iSense IMU structure.
mrpt::poses::CPose3D m_sensorPose
unsigned int m_toutCounter
Timeout counter (for internal use only)
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...
This class allows loading and storing values and vectors of different types from a configuration text...
bool read_bool(const std::string §ion, const std::string &name, bool defaultValue, bool failIfNotFound=false) const
int read_int(const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const
float read_float(const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const
GLsizei GLsizei GLenum GLenum const GLvoid * data
GLsizei const GLchar ** string
@ IMU_Y_ACC_GLOBAL
y-axis acceleration (global/navigation frame) (m/sec2)
@ IMU_YAW_VEL_GLOBAL
yaw angular velocity (global/navigation frame) (rad/sec)
@ IMU_X_ACC_GLOBAL
x-axis acceleration (global/navigation frame) (m/sec2)
@ IMU_X_ACC
x-axis acceleration (local/vehicle frame) (m/sec2)
@ IMU_PITCH_VEL
pitch angular velocity (local/vehicle frame) (rad/sec)
@ IMU_ROLL_VEL_GLOBAL
roll angular velocity (global/navigation frame) (rad/sec)
@ IMU_PITCH
orientation pitch absolute value (global/navigation frame) (rad)
@ IMU_YAW
orientation yaw absolute value (global/navigation frame) (rad)
@ IMU_X_VEL
x-axis velocity (global/navigation frame) (m/sec)
@ IMU_Z_ACC
z-axis acceleration (local/vehicle frame) (m/sec2)
@ IMU_Z_VEL
z-axis velocity (global/navigation frame) (m/sec)
@ IMU_PITCH_VEL_GLOBAL
pitch angular velocity (global/navigation frame) (rad/sec)
@ IMU_ROLL_VEL
roll angular velocity (local/vehicle frame) (rad/sec)
@ IMU_YAW_VEL
yaw angular velocity (local/vehicle frame) (rad/sec)
@ IMU_Y_ACC
y-axis acceleration (local/vehicle frame) (m/sec2)
@ IMU_Y_VEL
y-axis velocity (global/navigation frame) (m/sec)
@ IMU_ROLL
orientation roll absolute value (global/navigation frame) (rad)
@ IMU_Z_ACC_GLOBAL
z-axis acceleration (global/navigation frame) (m/sec2)
void BASE_IMPEXP sleep(int time_ms) MRPT_NO_THROWS
An OS-independent method for sending the current thread to "sleep" for a given period of time.
mrpt::system::TTimeStamp BASE_IMPEXP secondsToTimestamp(const double nSeconds)
Transform a time interval (in seconds) into TTimeStamp (e.g.
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
#define THROW_EXCEPTION(msg)
Contains classes for various device interfaces.
This namespace contains representation of robot actions and observations.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...