Skip to content

Commit

Permalink
Version 4.0.0: Added support to MTi-7 device, merge pull request #32
Browse files Browse the repository at this point in the history
…and #33
  • Loading branch information
arunvydhya committed Jul 4, 2018
1 parent 25a0417 commit 691fab0
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog for package xsens_mti_ros_node

## 4.0.0 (2018-07-04)
* Merge pull request #33: Change custom_msgs to xsens_msgs
* Merge pull request #32: Configure MTi device on startup
* Added support to MTi-7 device

## 3.0.2 (2018-04-24)
* Added warning (rospy.logwarn) for timeouts

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$ . $CATKIN/devel/setup.bash
$ rostopic echo /mti/sensor/imu
```
Tested with ROS Kinetic distribution, initially developed for ROS Indigo distribution.

# Troubleshooting

Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
25 changes: 14 additions & 11 deletions src/xsens_driver/config/xsens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,33 @@
device: /dev/ttyUSB0

# Baudrate. If configure_on_startup is true, will set device to use baudrate
baudrate: 230400
baudrate: 115200

# Frame id which is assigned to all sensor data messages
frame_id: xsens

# Will configure the device on startup
configure_on_startup: true

# Output data rate of device. Valid values: 1, 2, 4, 5, 10, 20, 40, 50, 80, 100, 200, 400
odr: 40
# Output data rate of device. Valid values: 1, 2, 4, 5, 10, 20, 40, 50, 80, 100, 200, 400, 800
# Refer to MT Low Level Communication Protocol Documentation for supported ODRs for each MTi series
# https://base.xsens.com/hc/en-us/articles/207003759-Online-links-to-manuals-from-the-MT-Software-Suite
odr: 10

# xkf-scenario
# general: 39
# high_mag_dep: 40
# dynamic: 41
# low_mag_dep: 42
# vru_general: 43 (only profile available for mti-20)
xkf_scenario: 43
# Filter profiles (xkf-scenario)
# MTi-2 [VRU_general:54]
# MTi-2 [General:50, High_mag_dep:51, Dynamic:52, North_referenced:53, VRU_general:54]
# MTi-7 [General:11, GeneralNoBaro:12, GeneralMag:13]
# MTi-20/200 [VRU_general: 43]
# MTi-30/300 [General:39, High_map_dep:40, Dynamic:41, Low_mag_dep:42, VRU_general:43]
# MTi-G-710 [General:1, GeneralNoBaro:2, GeneralMag:3, Automotive:4 HighPerformanceEDR:5)
xkf_scenario: 11

# Output data mode
# 1: sensor data
# 2. sensor data w/ rate quantities
# 3: filter estimates
output_mode: 2
output_mode: 3

# Use rostime for IMU stamp instead of sensor reported time
use_rostime: true
4 changes: 2 additions & 2 deletions src/xsens_driver/package.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<package>
<name>xsens_driver</name>
<version>3.0.2</version>
<version>4.0.0</version>
<description>
ROS Driver for publishing mti sensor sample messages (MTi 1-series, MTi 10-series and MTi 100-series incl. MTi-G-710).
ROS Driver for publishing mti sensor sample messages (MTi 1-series incl. MTi-7, MTi 10-series and MTi 100-series incl. MTi-G-710).
</description>
<maintainer email="[email protected]">Xsens</maintainer>
<license>BSD</license>
Expand Down
2 changes: 1 addition & 1 deletion src/xsens_driver/src/mtdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ class XDIMessage:

class XDIProductMask:
"""Product masks for the Xsens MTi series devices."""
FMT1000Series = "c" # 0x0C
MTi1Series = "8" # 0x08
MTi7Device = "7" # 0x07
MTi10Series = "6" # 0x06
MTi100Series = "7" # 0x07
MTi700Device = "7" # this is a subset of the 100-series
Expand Down
18 changes: 9 additions & 9 deletions src/xsens_driver/src/mtdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def configureMti(self, mtiSampleRate, mtiMode):
if mtiSampleRate < int(new_pressure_period):
new_pressure_period = mtiSampleRate

if (deviceIDProductMask[2] == XDIProductMask.MTi1Series) | (deviceIDProductMask[2] == XDIProductMask.FMT1000Series):
if (deviceIDProductMask[2] == XDIProductMask.MTi1Series):
new_imu_period = rate_imu_period = new_mag_period = XDIMessage.FsModule
if mtiSampleRate < int(new_imu_period):
new_imu_period = rate_imu_period = new_mag_period = mtiSampleRate
Expand Down Expand Up @@ -485,21 +485,21 @@ def configureMti(self, mtiSampleRate, mtiMode):
data = mStf+mSw+mOrientation
else:
raise MTException("unknown mtiMode: (%d)."% (mtiMode))
elif deviceIDProductMask[2] == XDIProductMask.MTi1Series:
print "MTi-1/2/3 device detected"
elif (deviceIDProductMask[2] == XDIProductMask.MTi1Series) & (deviceTypeMask[2] == XDIProductMask.MTi7Device):
print "MTi-7 device detected"
if mtiMode == 1:
print "Enabled publishing all sensor data"
data = mStf+mImuDq+mImuDv+mImuMag+mSw+mOrientationQuat
data = mStf+mImuDq+mImuDv+mImuMag+mImuP+mGnssPvt+mSw+mOrientationQuat
elif mtiMode == 2:
print "Enabled publishing all sensor data (rate quantities)"
data = mStf+mImuGyr+mImuAcc+mImuMag+mSw+mOrientationQuat
data = mStf+mImuGyr+mImuAcc+mImuMag+mImuP+mGnssPvt+mSw+mOrientationQuat
elif mtiMode == 3:
print "Enabled publishing all filter estimates"
data = mStf+mSw+mOrientation
data = mStf+mSw+mOrientation+mVelocity+mPosition+mHeight
else:
raise MTException("unknown mtiMode: (%d)."% (mtiMode))
elif deviceIDProductMask[2] == XDIProductMask.FMT1000Series:
print "FMT-1010/1020/1030 device detected"
elif deviceIDProductMask[2] == XDIProductMask.MTi1Series:
print "MTi-1/2/3 device detected"
if mtiMode == 1:
print "Enabled publishing all sensor data"
data = mStf+mImuDq+mImuDv+mImuMag+mSw+mOrientationQuat
Expand All @@ -510,7 +510,7 @@ def configureMti(self, mtiSampleRate, mtiMode):
print "Enabled publishing all filter estimates"
data = mStf+mSw+mOrientation
else:
raise MTException("unknown mtiMode: (%d)."% (mtiMode))
raise MTException("unknown mtiMode: (%d)."% (mtiMode))
else:
raise MTException("Unknown device")

Expand Down

0 comments on commit 691fab0

Please sign in to comment.