Skip to content

Conversation

@anurag-choudhury
Copy link

@anurag-choudhury anurag-choudhury commented Nov 25, 2024

PR Summary

This PR resolves multiple issues and introduces new functionalities related to motion control and odometry for the robot using the Roboteq FBL2360TE motor controller.


Problem Resolved

1. cmdVelCallback Improvements:

  • Fixed an issue where the second motor was not being controlled correctly, causing improper robot motion.
  • Previous logic for combining linear and angular velocities to compute motor speeds had errors, leading to inaccurate motor behavior.

2. Opposite Direction Rotation in Diff-Drive:

  • Resolved an issue causing the robot to rotate in the opposite direction when turning.
  • Fixed kinematic calculations to ensure proper left and right motor behavior.

New Features

1. Odometry Calculation Node:

  • Added a new node to calculate odometry (odom_calculation_node) based on encoder data.
  • Computes the robot's position (x, y) and orientation (theta) in the odom frame.
  • Publishes odometry information and broadcasts the transform (odom -> base_link).

2. Launch File Modifications:

  • Updated the launch file to include the new odometry calculation node for seamless integration.
  • Suggested renaming the launch/driver.py file to launch/driver.launch.py for better ROS 2 launch compatibility.

Impact

1. Enhanced Motion Control:

  • Both motors now respond appropriately to combined linear and angular velocity commands.
  • Fixed behavior ensures accurate forward motion, turning, and stopping commands.

2. Accurate Odometry:

  • Provides precise position and orientation updates for navigation and mapping applications.

3. Improved Debugging:

  • Logs added to both cmdVelCallback and the odometry calculation node for better visibility of internal states and computations.

Testing

Hardware Validation:

  • Forward Motion: Verified that linear.x > 0 moves both motors at equal speeds.
  • Turning: Confirmed angular.z ≠ 0 generates differential motor speeds for turning.
  • Stopping: Validated that linear.x = 0 and angular.z = 0 halts both motors.

Odometry Node Validation:

  • Verified odometry outputs using encoders for position (x, y) and orientation (theta).
  • Confirmed that transform broadcasting (odom -> base_link) aligns with real-world robot motion.

Modes Tested:

  • Tested in open-loop (power control) and closed-loop (RPM control) modes.

Checklist

  • Fixed second motor control in cmdVelCallback.
  • Resolved opposite rotation in diff-drive.
  • Odometry node #4 Added odometry calculation node.
  • Updated launch file to integrate new node.
  • Logs added for better debugging.
  • Documentation and comments updated for clarity.

Additional Notes

  • Suggestion: Rename the file launch/driver.py to launch/driver.launch.py to improve readability and ROS 2 launch compatibility.
  • Ready for review and feedback. Additional improvements or suggestions are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant