Some doubts about ardurover, ros2 and wheels encoders

hello everyone first thanks for your attention,

I am something new with Ros2 and mavros and I have some doubts, I don’t know if someone can help me/

  1. in my rover I am using 2 encoders and I configure them following this guide “Wheel Encoders — Rover documentation” I was able to read it from the mavlink without problems and see that if I moved the engine it changed the distance traveled, but when I wanted to read it from mavros, I couldn’t find in which topic it sends the encoder data, Does anyone know in what topic you send me the data? or what configuration do I have to modify to be able to obtain the topic by mavros

2)I want the pixhawk to go into guided mode when it is turned on? Because although I configure it, it sends me an error because currently I have to configure the “Set Home Here”, “Set EKF Origin Here” manually from the mission planer it can be done automatically ?
3) I am currently using mavros together with ros2, the inconvenience I am having is that it is not totally stable and sometimes I have to execute the command more than 3 times in ros2 to be able to connect with mavros, someone knows if it is possible to correct this, or if there is any alternative to mavros that is stable?

Thank you and I am attentive to your answers :slight_smile:

Hi @giowidow,

I think the wheel encoder information is sent using the WHEEL_DISTANCE mavlink message. By the way, MP and QGC both have a “Mavlink Inspector” feature which pops up a window showing all the mavlink messages that have been received so far and their latest values. If using MP this is on the “Setup” / “Advanced” screen.

Rove has an INITIAL_MODE parameter to set the mode at startup but it seems broken so I’ve raised an issue to get this fixed. Even if we fix the immediate bug this method may not work for Guided mode because it requires a position estimate but we should fix this too.

We don’t have parameters to automatically set the ekf origin at startup so the vehicle needs to receive this information via mavlink or via a lua script. The lua script feature didn’t make it into 4.1 though so if you go this route you’ll need to install 4.2.0-DEV on the autopilot (which can be done by pressing Ctrl-Q on MP’s Install Firmware screen).

I don’t have much advice on mavros I’m afraid.

Hope this helps.