srmainwaring / curio

ROS packages to control a version of Roger Chen's Sawppy Rover.
Other
57 stars 20 forks source link

Odometry is not correct #17

Closed hiran-t closed 9 months ago

hiran-t commented 10 months ago

Hi~ I'm encountering an issue with odometry in Rviz not reflecting the actual movement of my rover robot. I'm able to successfully publish cmd_vel commands and control the robot's movement, but the odometry visualization in Rviz remains inaccurate. This prevents me from creating maps and using navigation features.

My steps to run package:

  1. Launch ROS nodes:

roslaunch curio_base arduino_controller.launch port:=/dev/ttyACM0

roslaunch curio_base base_controller.launch

roslaunch curio_viz veiw_robot.launch


2. Publish `cmd_vel` commands to the robot.
3. Observe that the robot moves as expected, but odometry in Rviz does not update correctly.

Hardware Setup:
- Computer
- Arduino
- BusLinker (connected to Arduino via RX/TX)
- Servo motors

Additional Observations:
- Only data from two servo motors (id21 and id12) is visible in the `/servo/encoder` topic.
- I'm unsure if further configuration within the package is required.

Questions:
1. What could be causing the discrepancy between the robot's actual movement and the odometry visualization in Rviz?

2. Are there any configuration adjustments I might need to make within the package?

I'd appreciate any guidance or suggestions to resolve this issue. Thank you for your help!
srmainwaring commented 10 months ago

Hi @hiran-t, the model was set up to only report wheel odometry from the two motors that did not steer (the middle two).

It's been a long time since I've updated this package - and I should probably archive it as I don't plan to update for ROS 1 any further and my rover's electronics are currently partially disassembled, so it would be difficult for me to verify changes.

You are of course welcome to maintain your own copy. My plans for the rover are to update to a combination of ROS 2 for planning and navigation and ArduPilot for low level control. This is the approach we're looking onto for a number of vehicle types, not just rovers. There is a version of the robot that runs in Gazebo Garden available on ArduPilot/SITL_Models and if you are interested in the direction things are going check out the ROS 2 / DDS support on the ArduPilot Dev Wiki.

hiran-t commented 10 months ago

I got it. To continue working with this package and get the correct odometry, could you please answer one more question? Should I only adjust the parameters in the base_controller.yaml file? @srmainwaring

srmainwaring commented 10 months ago

Should I only adjust the parameters in the base_controller.yaml file?

Yes - the two params

# Odometry calibration / tuning (default 1.0 - no adjustment)
wheel_radius_multiplier: 1.0
mid_wheel_lat_separation_multiplier: 0.96875

are used to tune the measured odom to actual. My rover only had encoders on the mid two wheels as I needed to modify the original motors. You could calculate odom for all 6 wheels, but would need to update the logic to account for the differing radii travelled by each of the wheels during a turn. In the end I found the lidar more useful and accurate for localisation as the odometry can drift quickly depending on the surface (wheel slip) and other effects.

hiran-t commented 10 months ago

Does that mean you're use laser to odometry later? I'm considering using it with the rf2o_laser_odometry package. And thank you for your support. @srmainwaring

srmainwaring commented 10 months ago

I used an RPLidar-A1 with the nav package for localisation. I included the odometry as well since the localisation package supports multiple inputs into the EFK. I didn't think it worth adding odometry for all wheels as I had good results with the mid-wheels and the LIDAR.

srmainwaring commented 9 months ago

Closing as no recent activity. @hiran-t, feel free to re-open if you have further questions.