Estimate gsof header.stamp based on PostitionTime or INSSolution#9
Estimate gsof header.stamp based on PostitionTime or INSSolution#9zthorson wants to merge 12 commits into
Conversation
Configure Mend for GitHub Enterprise
- Namespace was changed from trimble_driver_ros to trmb_ros but component was not updated - Update CMake file to match new namespace - Update launch composable node to the same namespace
- Many GSOF messages had header timestamps of 0,0, which causes issues for message filters - Added a flag to optionally use the closest known header timestamp to the GSOF message - This should be quite accurate of GSOF trimble-oss#1 or #49 has the highest system update rate
andre-nguyen
left a comment
There was a problem hiding this comment.
Thank you for the feature, looks pretty important for products that don't output gsof 49.
I tried it out on my unit and something doesn't seem to work for me. If I set the rate of gsof 1 to 1Hz and gsof 27 to 5Hz. My attitude info timestamp doesn't follow the time of week.
I'm thinking there is a problem where the template isn't being resolved properly?
I think I spot a problem with the template, the message I was trying to target uses a different name for the field: trimble_driver_ros/trimble_driver_ros/include/trimble_driver/gsof/message.h Lines 768 to 770 in ae97136 Since I'm really only trying to target Attitude Info (the only one that has a gps time in ms but no week info), I think it may make more sense to just write a specific template override for that particular message and avoid adding a special templating case. I'll look into it. |
I wouldn't be against renaming the field to |
- Better handle AttitudeInfo case where gps time in ms is available
- Handle BasePositionAndQualityIndicator, PositionTimeInfo, and CurrentTime correctly
- Updating field names in these would reduce the number of specialized templates needed at the expense of matching to documented field names
There are a few others that have specialized names and out of order fields. I ended up adding them to the specialized converter list as well, since I saw they were using the time estimate rather than their included time fields. I still have more work on this PR for cleanup, but feel free to take a look at the new template approach. Otherwise I should have access to the hardware again late next week for more testing. |
- Minor wording changes from PR
- Ran: find . -iname '*.h' -o -iname '*.cpp' -o -iname '*.hpp' | xargs clang-format-14 -i -style=file --fallback-style=llvm - Excluded /util/wise_enum folder from results
- Fix typos in comments and readme Co-authored-by: Andre Nguyen <andre-nguyen@users.noreply.github.com>



Description
This is an optional functionality improvment to add correct timestamp values to some ROS Gsof Messages that currently write 0,0 for the timestamp. It adds an additional flag to enable the feature, which defaults to off to maintain compatability with other releases.
Reason
In the current code, any Gsof ROS message that does not have a GPSTime field in the structure will not write a timestamp value to the header. In these cases the timestamp is always written as 0,0 in the GSOF message header. If you attempt to use a TimeSynchronized message filter to group GSOF messages with NavFix (or INS) messages, this will cause them to fail since the GSOF message timestamp will never match.
Method / Design
To address this a new parameter
estimate_gsof_timewas added to the ros parameters list. This defaults tofalsein order to retain the same default behavior.When
estimate_gsof_timeis set, the callback will use either the GSOFPositionTime (#1)gps time, or theINSSolution (#49)time as an estimate for other packets (Such asVelocity (#8) or Attitude (#27)). It has a preference for using the INS message, as that use case is likely more common.To get the best results, you would want the
PositionTime (#1)orINSSolution (#49)message to have the highest update rate of all messages. Ideally, it would also be a multiple of your lower frequency messages so that there is a good chance than GSOF will bundle the messages together on different pages of the same packet. This would give the most accurate stamp. Though in the worst case the timestamp would be off by 1/Hz s.There exists one GSOF message
Attitude (#27)that contains a special case. This packet has a gps_time_ms field with no associated week. To get the best timestamp, this packet will only use the GPSWeek from thePositionTime (#1)orINSSolution (#49)packet and use it's own gps_time_ms. There exists a small chance of some odd behavior during the gps week rollover, but if the packets are synced well this should not occur.Testing
Test Setup:
ros:humble-ros-baseDocker image** GPS Configuration **
estimate_gsof_time = false
Packets with no valid GPS time have a heading timestamp of 0,0:

estimate_gsof_time = true
Packets with no valid GPS time now estimate their time based on

PositionTime (#1)