Thread Tools
Oct 14, 2015, 02:55 AM
Registered User
Thread OP
Discussion

Xiro Xplorer HJ Log Processor


*** Update ***
To get the latest release, click on "View all Files in thread" at the bottom of this post, then click on the latest file to DL


This thread is related to a tcl/tk script that will extract information out of Xiro Xplorer HJ Log files. It is in a very early stage of development and will change quite a bit as capabilities are added.

Because it is a tcl/tk script it is cross platform and should work on any machine that supports tcl/tk.

Credits:

I used the source code for the YS Log Parser, developed by 'MrWestie" for information on the HJ log record, though there are some differences between that HJ record and the Xiro Xplorer record.

I used an application referenced on the Xirodrone Facebook page to do analysis on the log records. See http://www.zerouav.com/uploads/soft/...GEMINI-M-S.zip This software appears to be targeted to a different vehicle and has a 2009 copyright but the Flight Playback works for the Xplorer. It only runs on Windows, which I try to avoid.

Current capabilities of my script include ability to display the following fields extracted from the log record.
  • recnum
  • yr
  • mth
  • day
  • hr
  • min
  • sec
  • lat
  • lon
  • heading
  • alt
  • lontgt
  • lattgt
  • sats
  • fmode
  • flttim
  • mRud
  • mAil
  • mEle
  • mThrot
  • xVelX
  • xVelY
  • xVelD
  • wps
  • gVelX
  • gVelY
  • shake
  • vibr
  • volt
  • alttgt

The record includes additional fields that are not extracted in the version.

There are three output formats, though this will be expanded. Output can be saved as tab delineated or CVS files.
Last edited by TomKnAL; Nov 19, 2015 at 06:31 PM.
Sign up now
to remove ads between posts
Oct 15, 2015, 07:17 PM
Registered User
Thread OP

How to use hjlog


hjlog.tcl is a tcl/tk script and requires a tcl/tk interpreter to run.

Mac OX, Linux
tcl/tk is usually installed so the script will run without any extra effort.

Windows
If you can install software, ActiveTcl is the simplest solution.

http://www.activestate.com/activetcl

If you do not have adminstrator privileges, tclkit can be used.

http://tclkits.rkeene.org/fossil/wiki/Downloads

Tcl/Tk 8.6 for Windows X86 will work for most people.
Oct 15, 2015, 10:22 PM
Registered User
Thread OP
Conversation moved from YS-X6 Alternative GCS

Quote:
Originally Posted by TomKnAL
How are you using the logs? What is the issue you're investigating?

I have just finished a very early version of a cross-platform log script that converts the log file into readable text, in one of three formats.
...
I identified several flight modes but those are not included in the script yet.

Have you used this? http://www.zerouav.com/uploads/soft/...GEMINI-M-S.zip

Use Flight Playback to replay the flight.
Quote:
Originally Posted by JohnnyG_71
Hi Tom, that is great! Let me know if you need any testing / feedback on your script. I haven't been able to identify what the different flight modes mean yet.

I have noticed that the "Manual" positions are the positions commanded by the remote, and the "Realtime" positions are the positions that the drone is making *in addition to* the Manual. In other words, if you hold the throttle all the way up, and the drone climbs, you won't see a change in the "Realtime" other than the minor corrections it's commanding for stable flight. However, if you do a "return to Home", for example, you will see much larger commands appearing in the "Realtime" fields, as the drone is now commanding the full flight. <Hopefully that makes sense>.

I haven't tried the replay software yet. I'll have to try that when I get home, thanks!

I'm using the logs to try to identify a problem I keep experiencing. While hovering in stable flight, you'll hear & see the drone make a sudden drop, and then recover back to where it was. I noticed a couple of times, in the app, that when this occurred, the altitude showed, negative or positive, two thousand and some, for a brief moment. I've only flown the drone four times, but now am concerned about flying it at all until I know what's going on. I don't want it crashing and hurting anyone. I installed the latest firmware the moment I opened the box.
That's my understanding of the Real vs Manual modes, though I have not been able to identify the Real mode values from the log file. My interpretation is a little different though. I think you will more variance in the Real mode, in response to wind and other factors.
Oct 15, 2015, 11:19 PM
Registered User
Thread OP

HJ Log Record Notes


HJ Log Record Field Notes


First Column = Decimal Offset
Second Column = Hex Offset
Third Column = Length
Fourth Column = Data Type
c = 8 bit signed
cu = 8 bit unsigned
s/S = 16 bit
a = char. also used to combine bytes for second scan
f = 32 bit float

Several fields appear to use 150/x96 as a midpoint so they are similar to a signed byte.

Each line represents 1 byte position so blank lines follow s/S/f fields

Code:
0	0	4	a4	'$STP'



4	4	4	f	lat



8	8	4	f	lon



12	c	4	f	lontgt



16	10	4	f	lattgt



20	14	4	f	headingr	-pi..pi (radians)



24	18	1	c	satellite count
25	19	1	c	yr
26	1a	1	c	mnth
27	1b	1	c	day
28	1c	1	c	hr
29	1d	1	c	min
30	1e	1	c	sec
31	1f	1	c	# of waypoints - only set on upload
32	20	1	c	Manual servo position Rudder		x Inactive 150/96 default
33	21	1	c	Manual servo position Aileron		x very little variance  x96 afew x9? 
34	22	1	c	Manual servo position Elevator	Active
35	23	1	c	Manual servo position Throttle	Active 200 - $v
36	24	1	c	Realtime servo position Rudder	x Inactive/not used ??
37	25	1	c	Realtime servo position Aileron	x Inactive/not used ??
38	26	1	c	Realtime servo position Elevator	x Inactive/not used ??
39	27	1	c	Realtime servo position Throttle	Active but puzzling offsets
40	28	2	S	xekf_VelX

42	2a	1	x	UNKNOWN	
43	2b	1	x	UNKNOWN
44	2c	1	x	UNKNOWN
45	2d	1	x	UNKNOWN
46	2e	1	a	DTB_Hi	Distance to Base
47	2f	1	x	UNKNOWN
48	30	2	s	Altitude cm

50	32	2	s	GPS_VelX

52	34	1	a	DTB_Lo
53	35	1	x	UNKNOWN
54	36	1	c	Shake	
55	37	1	x	Not Used - mostly constant 3 - sometimes 1
56	38	1	c	Vibrate 'F-B' prefix ?  - 
57	39		x	???	UNKNOWN
58	3a		x	???	UNKNOWN
59	3b		x	???	UNKNOWN
60	3c		x	???	UNKNOWN
61	3d		x	???	UNKNOWN
62	3e	2	s	Attitude Indicator AI Up/Down	+ =  Up

64	40	1	x	???	UNKNOWN
65	41	1	x	???	UNKNOWN
66	42	2	s 	Attitude Indicator AI	L/R +  = Left

68	44		x	???	UNKNOWN
69	45		x	???	UNKNOWN
70	46	2	s	Batt. $v / 204.8 = V

72	48		x	???	UNKNOWN
73	49		x	???	UNKNOWN
74	4a		x	???	UNKNOWN
75	4b	1	c	Flying Mode
76	4c		x	???	UNKNOWN
77	4d		x	???	UNKNOWN
78	4e		x	???	UNKNOWN
79	4f	1	a	xekf_VelD	high byte
80	50	1	cu	Manual Rudder		LR_96
81	51	1	cu	Manual Aileron		LR_96
82	52	1	cu	Manual Elevator	Push/Pull_96
83	53	1	a	xekf VelY	high byte
84	54	2	s	Tgt alt 	cm
86	56		x	???	UNKNOWN
87	57		x	???	UNKNOWN
88	58		x	???	UNKNOWN
89	59	1	a	xekf_VelD	lo byte
90	5a	2	s	Flight time - seconds

92	5c	1	c	Amps ? not functional
93	5d	1	a	xekf VelY	low byte
94	5e	2	s	GPS VelY

96	60	1	a	???	UNKNOWN
97	61	1	a	???	UNKNOWN
98	62	1	a	???	UNKNOWN
Oct 15, 2015, 11:36 PM
Registered User
Thread OP

Xiro Xplorer Flight Modes


I have found these modes in Xiro Xplorer logs.
  • 1 - Auto Hover is GPS Mode
  • 2 - Auto Navigation is Preprogrammed Waypoints
  • 5 - Auto waypoint circling showed up
  • 6 - Semi automatic was active on at least one occasion when the Xplorer decided to land immediately.
  • 11 - Return Home Mode

These modes were extracted from the MULTICOPTER-PC_GCS-YS-X4-X4P software.

0 - Manual
3 - Circle position
4 - Realtime waypoint
7 - Settings State
8 - Zero Gyro
9 - ALT Error
10 - Airspeed Error
12 - Manual Set Altitude
Oct 18, 2015, 11:24 PM
Registered User
Thread OP

Follow Me/Photo Me


I did some experiments with the Photo(Circle) Me and Follow Me modes Saturday. Both modes show up in the log file as Mode 9. This shows up as "Alt Error" on the MULTICOPTER-PC_GCS-YS-X4-X4P track playback.

This image is a screen capture on GPSVisualizer, using text copied from the HJlog window using the Lat/Lon/Alt format.
Nov 09, 2015, 05:26 AM
Registered User
Thread OP

Version 0.2.0


This version includes additional formats, extracts additional fields, and includes some very basic help. There are still quite a few things that need to be revised and improved.

hjlog is tcl/tk script that converts hj log file into human readable form. It is in very early development and there will be many improvements over time. The current version can be useful as is, but it is not fully functional in many respects.

Eventually, it will be able to draw the course defined in the log file as well as to graph user selected log values over time. I hope to provide an option to add flight parameters to a SRT close caption file, so that flight parameters can be displayed during the flight, though this may not work.

The main function is the "Open HJ File", which reads an HJ file and displays the log data in one of several formats. "Save Text - Tab" and "Save Text - CSV" will save the current data as either tab delineated or comma separated values. Currently these are not well tested.

Format - selects which of several formats used to display the log data..

"Raw" shows the data in basic form with relatively few transformations. For example, mRud uses 150 as "centered". Some transforms are applied. The Heading is logged as radians from pi to -pi, but this is changed to degrees, 0 to 360.

"All Records" shows all parameters. If unchecked only log records generated while flying are shown, though this is currently implemented only for "All" format.

"TrackInfo" includes calculated values including distance from base, and delta distance.

"Lat/Lon/Alt" shows just lat, lon, altitude, and heading. It can be used with GPSVisualizer to show the track. Currently the column headers need to be added though this will probably be fixed.

Currently many parameters are extracted, but the meaning of some of these is not clear and there may be errors.

yr mnth day hr min sec - Each record includes a GPS time stamp though there may be multiple records with the same time. Sequential records may be more than one second apart.

lat lon heading alt - Latitude, Longitude, Heading ( 0 N 90 E 180 S 270 W ), Altitude in meters

Target Latitude, Target Longitude, Target Altitude. In preprogrammed flight mode, the Target Lat/Lon will be the next waypoint, though I'm not sure how it it is used in normal flight.

Sats - # of GPS Satellites
WPs - # of Waypoints - this will increment when a waypoint is uploaded. I'm not sure what, if anything, it means in normal flight.

Flight Mode
0 Manual - Attitude Mode
1 Auto Hover - GPS mode
2 Auto Navigation - Preprogrammed Flight
5 Auto waypoint circling
6 Semi-automatic
9 Follow/Photo Me?
11 Return Home ('B')

Flight Time - in seconds
mRud mAil mEle mThrot - Manual Rudder, Aileron, Elevator, Throttle - Manual = User input

rRud rAil rEle rThrot - Real Rudder, Aileron, Elevator, Throttle - I think these are the 'real' inputs generated from the user inputs, but I'm not real confident about these.

xVelX xVelY xVelD - Extended Kalman Filter Velocities

gVelX gVelY - GPS X, y velocities

Shake, Vibration I'm not sure what the units are of teh exact meaning of the terms.

AIud AIlr - Attitude Indicator, Up/Down, Left/Right

DTB - Distance to Base

gBack gDown gRight - G ratings

Power Percent - Starts at or near 100% and goes down during the flight

Battery Voltage - Usually ranges from 12.5 to 10.7 V.

mAh - Not sure what this means though the unit is used to measure battery capacity. It is related to power because it tends to stay at a single value until takeoff, then increments by one for each minute of flight.
Nov 09, 2015, 08:04 AM
Flint Hills Dude's Avatar
Quote:
Originally Posted by TomKnAL
This version includes additional formats, extracts additional fields, and includes some very basic help. There are still quite a few things that need to be revised and improved.
Awesome contribution. I'm learning a lot. Thanks for your efforts.
Dec 09, 2015, 01:57 AM
Registered User
Thread OP

Google Earth Flight Path


This is a capture of a Google Earth track using a KML file based on the hjlog information.

The first image is looking down on the track.The red line is the track on the ground. The white line is the track in the air.

The second image is a ground level view. The inclined track shows the Xplorer coming out of a ditch at about a 30% angle. The vertical line on the right shows a climb from 15m to 56 m , or 195m to 236m ASL. The vertical lines in the center are takeoff and landing.
Dec 23, 2015, 03:56 AM
Registered User
Thread OP

hjlog 0.3.0


Version 0.3.0 has many improvements. The save_tab and save_csv functions work for all formats.

There are two new and major capabilities, 'CC' and 'KML'.

'KML' will generate a kml file that can be used with Google Earth to generate 3D or flat flight paths. Using the "Show Elevation Profile" is easy to see the altitude at different points in the flight as well as the total distance travelled. Altitude above sea level is used so it is necessary to enter the altitude above sea level of the take off point. Enter an altitude of 0 to get a flat track.

A png screen capture is attached. The kml file used for this image is also attached. To use it, save it and change the name from'kml.txt' to 'kml', then open it with Google Earth.
Dec 23, 2015, 04:07 AM
Registered User
Thread OP

hjlog.tcl 0.3.0 - Close Captioned Telemetry


The CC capability is in its early stages but is working. It will generate a .sbv file than can be uploaded to youtube to include flight telemetry as close captions.

This video includes close captions that were generated from the HJ log file. The fields in the captions are heading, altitude(m), flight time (sec), distance from base (m), and flight mode. 2 is preprogrammed flight mode, and 6 is semi-auto. The Xplorer goes into semi-auto mode at a ~79 seconds into the flight, at a distance of 316m from the base.

Preprogrammed Flight - Autoland (1 min 59 sec)


I think Close Captions will be turned on when the video is loaded, but they must be turned on to see the log data.

These fields are supported. Some are calculated.
minsec
dx
dy
altm
dist
lat
lon
heading
fmode
flttim
mRud
mAil
mEle
mThrot
xVelX
xVelY
xVelD
gVelX
gVelY
shake
vibr
volt
alttgt
AIud
AIlr
DTB
Last edited by TomKnAL; Dec 23, 2015 at 03:37 PM. Reason: Fixed youtube URL
Dec 23, 2015, 04:16 AM
Registered User
Thread OP

hjlog.tcl 0.3.0


Zip file of hjlog.0.3.0 attached
Last edited by TomKnAL; Dec 23, 2015 at 04:22 PM.
Dec 23, 2015, 07:25 AM
Flint Hills Dude's Avatar
Quote:
Originally Posted by TomKnAL
Zip file of hjlog.0.3.0.zip attached
Thanks!
Dec 23, 2015, 11:51 PM
Registered User
Thread OP

Version 0.3.1


Minor tweaks
  • Added another space between fields in captions
  • Swiched xdist and ydist so that X - longitude and Y - latitude
added a space between fields in captions

Demo/test:
Creek Tour + Telemetry Test (12 min 57 sec)
Dec 28, 2015, 04:42 AM
Registered User
Thread OP

Version 0.3.2


Fairly minor changes.
  • Includes INFORMATION block in .sbv file
  • Handles V.2.0.x hj log file names better - The file names are longer.


Quick Reply
Message:

Thread Tools