ethz-asl / ethzasl_xsens_driver

Driver for xsens IMUs
BSD 2-Clause "Simplified" License
102 stars 111 forks source link

Problem with MTi-G-700 #36

Closed metzge-ka closed 7 years ago

metzge-ka commented 7 years ago

Dear Francis,

I have another issue...it would be awesome if you could help me :-) When I connect an MTi-G-700 sensor and run: pi@raspberrypi:~/catkin_ws/src/ethzasl_xsens_driver-master/nodes $ ./mtdevice.py -e I get the following output: _{'Status': {'StatusWord': 129}, 'Timestamp': {'PacketCounter': 321, 'SampleTimeFine': 64662}, 'Orientation Data': {'Yaw': 0.006209181156009436, 'Pitch': -0.04300256446003914, 'frame': 'ENU', 'Roll': 0.5484659075737}} {'GNSS': {'numSvs': 11, 'iTOW': 6500, 'svs': [{'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}, {'gnssId': 1, 'cno': 45, 'svId': 147, 'flags': 35}]}, 'Timestamp': {'PacketCounter': 322, 'SampleTimeFine': 2827657820L}} {'Status': {'StatusWord': 129}, 'Timestamp': {'PacketCounter': 323, 'SampleTimeFine': 64762}, 'Orientation Data': {'Yaw': 0.006437348201870918, 'Pitch': -0.04260209575295448, 'frame': 'ENU', 'Roll': 0.5487979650497437}} Traceback (most recent call last): File "./mtdevice.py", line 1704, in main() File "./mtdevice.py", line 1470, in main print mt.read_measurement(mode, settings) File "./mtdevice.py", line 632, in read_measurement return self.parse_MTData2(data) File "./mtdevice.py", line 937, in parse_MTData2 parse_GNSS(data_id, content, ffmt)) File "./mtdevice.py", line 756, in parseGNSS content) ValueError: too many values to unpack

Am I doing something wrong in the settings with the MTmanager? It doesn't matter what I enable with the sensor, it seems to have something to do with the GPS signal or packets...or more precise with the unpacking.

If I run: pi@raspberrypi:~/catkin_ws/src/ethzasl_xsens_driver-master/nodes $ ./mtdevice.py -b 0 -v -i _Trying 115200 bd: MT: Write message id 0x30 (GoToConfig) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x31 (GoToConfigAck) with 0 data bytes: [] MT: Write message id 0x0C (ReqConfiguration) with 0 data bytes: [] MT: Got message id 0x0D (Configuration) with 118 data bytes: [07 70 04 5E 04 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 07 70 04 5E 00 00 00 00 00 00 00 01 00 01 01 04 05 37 03 00] MT: Write message id 0x30 (GoToConfig) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x31 (GoToConfigAck) with 0 data bytes: [] MT: Write message id 0x10 (GoToMeasurement) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x11 (GoToMeasurementAck) with 0 data bytes: [] ok. MT: Write message id 0x30 (GoToConfig) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x31 (GoToConfigAck) with 0 data bytes: [] MT: Write message id 0x0C (ReqConfiguration) with 0 data bytes: [] MT: Got message id 0x0D (Configuration) with 118 data bytes: [07 70 04 5E 04 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 07 70 04 5E 00 00 00 00 00 00 00 01 00 01 01 04 05 37 03 00] Device: /dev/ttyUSB0 at 115200 Bd: device ID: MT: Write message id 0x00 (ReqDID) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x01 (DeviceID) with 4 data bytes: [07 70 04 5E] 0x0770045E product code: MT: Write message id 0x1C (ReqProductCode) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x1D (ProductCode) with 20 data bytes: [4D 54 69 2D 47 2D 37 30 30 2D 32 41 38 47 30 20 20 20 20 20] 'MTi-G-700-2A8G0' firmware revision: MT: Write message id 0x12 (ReqFWRev) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x13 (FirmwareRev) with 11 data bytes: [01 04 05 00 00 00 55 00 00 C3 C0] (1, 4, 5) baudrate: MT: Write message id 0x18 (SetBaudrate) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x19 (SetBaudrateAck) with 1 data bytes: [02] 2 error mode: MT: Write message id 0xDA (SetErrorMode) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x42 (Error) with 5 data bytes: [04 00 00 00 00] message unsupported by your device. option flags: MT: Write message id 0x48 (SetOptionFlags) with 0 data bytes: [] MT: Got message id 0x42 (Error) with 5 data bytes: [04 00 00 00 00] message unsupported by your device. location ID: MT: Write message id 0x84 (SetLocationID) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x85 (SetLocationIDAck) with 2 data bytes: [00 00] 0x0000 transmit delay: MT: Write message id 0xDC (SetTransmitDelay) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x42 (Error) with 5 data bytes: [04 00 00 00 00] message unsupported by your device. synchronization settings: MT: Write message id 0x2C (SetSyncSettings) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x2D (SetSyncSettingsAck) with 12 data bytes: [09 01 01 00 00 00 00 00 00 00 00 FA] [(0x09, 0x01, 0x01, 0x00, 0x0000, 0x0000, 0x0000, 0x00FA)] general configuration: MT: Write message id 0x0C (ReqConfiguration) with 0 data bytes: [] MT: Got message id 0x0D (Configuration) with 118 data bytes: [07 70 04 5E 04 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 07 70 04 5E 00 00 00 00 00 00 00 01 00 01 01 04 05 37 03 00] { 'Master device ID': 124781662, 'date': '\x00\x00\x00\x00\x00\x00\x00\x00', 'device ID': 124781662, 'length': 0, 'number of devices': 1, 'output-mode': 0, 'output-settings': 1, 'period': 1152, 'skipfactor': 0, 'time': '\x00\x00\x00\x00\x00\x00\x00\x00'} output configuration (mark IV devices): MT: Write message id 0xC0 (SetOutputConfiguration) with 0 data bytes: [] MT: Got message id 0xC1 (SetOutputConfigurationAck) with 12 data bytes: [10 20 FF FF 10 60 FF FF 70 10 00 04] [(0x1020, 65535), (0x1060, 65535), (0x7010, 4)] string output type: MT: Write message id 0x8E (SetStringOutputType) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x8F (SetStringOutputTypeAck) with 2 data bytes: [00 00] 0 period: MT: Write message id 0x04 (SetPeriod) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x05 (SetPeriodAck) with 2 data bytes: [04 80] 1152 alignment rotation sensor: MT: Write message id 0xEC (SetAlignmentRotation) with 1 data bytes: [00] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0xED (SetAlignmentRotationAck) with 16 data bytes: [3F 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00] (1.0, 0.0, 0.0, 0.0) alignment rotation local: MT: Write message id 0xEC (SetAlignmentRotation) with 1 data bytes: [01] MT: Got message id 0xED (SetAlignmentRotationAck) with 16 data bytes: [3F 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00] (1.0, 0.0, 0.0, 0.0) output mode: MT: Write message id 0xD0 (SetOutputMode) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0xD1 (SetOutputModeAck) with 2 data bytes: [00 00] 0x0000 extended output mode: MT: Write message id 0x86 (SetExtOutputMode) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x87 (SetExtOutputModeAck) with 2 data bytes: [00 00] 0x0000 output settings: MT: Write message id 0xD2 (SetOutputSettings) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0xD3 (SetOutputSettingsAck) with 4 data bytes: [00 00 00 01] 0x00000001 GPS coordinates (lat, lon, alt): MT: Write message id 0x6E (SetLatLonAlt) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x6F (SetLatLonAltAck) with 24 data bytes: [40 48 0A DB 60 92 81 D5 40 26 8E 1E B5 31 42 7C 40 83 8D B4 48 EC FC 00] (48.08481986192388, 11.277578031790874, 625.7130297197727) available scenarios: MT: Write message id 0x62 (ReqAvailableScenarios) with 0 data bytes: [] MT: Got message id 0x63 (AvailableScenarios) with 110 data bytes: [01 07 47 65 6E 65 72 61 6C 20 20 20 20 20 20 20 20 20 20 20 20 20 02 07 47 65 6E 65 72 61 6C 4E 6F 42 61 72 6F 20 20 20 20 20 20 20 03 07 47 65 6E 65 72 61 6C 4D 61 67 20 20 20 20 20 20 20 20 20 20 04 07 41 75 74 6F 6D 6F 74 69 76 65 20 20 20 20 20 20 20 20 20 20 05 07 41 75 74 6F 55 72 62 61 6E 43 61 6E 79 6F 6E 20 20 20 20 20] [ (1, 7, 'General'), (2, 7, 'GeneralNoBaro'), (3, 7, 'GeneralMag'), (4, 7, 'Automotive'), (5, 7, 'AutoUrbanCanyon')] current scenario ID: MT: Write message id 0x64 (SetCurrentScenario) with 0 data bytes: [] MT: Got message id 0x65 (SetCurrentScenarioAck) with 2 data bytes: [00 01] 1 UTC time: MT: Write message id 0x60 (SetUTCTime) with 0 data bytes: [] waiting for 1 bytes, got 0 so far: [] MT: Got message id 0x61 (UTCTime) with 12 data bytes: [1F 58 98 E0 07 E1 02 1B 0A 04 1A 00] (525900000, 2017, 2, 27, 10, 4, 26, 0)_

This looks fine for me ...

fcolas commented 7 years ago

Thanks for the report. I guess I see the problem. Can you checkout the branch fix_gnss_pvt_parsing and tell me if it's better?

metzge-ka commented 7 years ago

Thanks, but I am not sure what to do exaclty. What do you mean by checkout the branch fix_gnss_pvt_parsing? (I cannot find a variable with that name...) Do you mean the method parse_GNSS()?

fcolas commented 7 years ago

Well, a branch is a git concept you might want to learn about. Here is a good introductory book: https://git-scm.com/book/en/v2

hlware commented 7 years ago

I had the same Problem with unpacking GNSS messages. The branch fix_gnss_pvt_parsing solved that unpacking problem, with additionally correcting line 767 o['bdop'] *= 0.01 to o['ndop'] *= 0.01. However this fix directly results in the next error File ".../mtnode.py", line 508, in fill_from_GNSS self.gps_msg.status.service = NavSatStatus.SERVICE_GPS AttributeError: 'int' object has no attributee 'service'

fcolas commented 7 years ago

Thanks for the report. I supposedly fixed both issues: can you confirm?

hlware commented 7 years ago

Thanks a lot, that solved the problem.

fcolas commented 7 years ago

Great, I'll merge it in.