septentrio-gnss / septentrio_gnss_driver

ROS 1 & 2 driver for Septentrio GNSS & INS receivers
BSD 3-Clause "New" or "Revised" License
72 stars 37 forks source link

Invalid argument for setting lever arm #73

Closed Jad-Tawil closed 1 year ago

Jad-Tawil commented 1 year ago

The driver is reading frames from tf. The following is the message received from the receiver:

[ERROR] [1665063739.518137652]: /septentrio_gnss: Invalid command just sent to the Rx! The Rx's response contains 47 bytes and reads:
 $R? setINSAntLeverArm: Argument 'X' is invalid!

I am printing the exact string being formed prior to the sending, which is:

sial, 0.03639, 0.176597, -0.836319

Looking at the manual, this looks correct.

Why would the receiver respond this way?

Jad-Tawil commented 1 year ago

Btw, this is not a problem of the driver. I ran the same command in the expert console of RxControl and the same message was returned:

invalid_lever_X

thomasemter commented 1 year ago

Thank you for pointing this out.

This is indeed a bug in the driver. The representation of the floating point numbers is limited to 3 decimal places. The function in the driver string_utilities::trimString should trim it accordingly but does not seem to work correctly.

Using the newer function string_utilities::trimDecimalPlaces(settings_->ant_lever_x) instead of string_utilities::trimString(std::to_string(settings_->ant_lever_x)) should do the trick. We will fix this for the next release.

Btw., sial, 0.036, 0.176, -0.836 should work in RxControl.

Jad-Tawil commented 1 year ago

Understood. So the receiver does not accept more than 3 decimal places? That means that nothing more precise than millimeters is processed? That seems strange, accuracy is obviously impacted in that situation.

thomasemter commented 1 year ago

In my opinion, millimeter precision should be adequate for lever arms. We have set up several robots and we were never able to measure them more precisely.

If highest accuracy matters for your application, also make sure to specify your antenna types:

Jad-Tawil commented 1 year ago

Thank you Thomas, Your suggested modification worked in writing the info to the receiver.