I’m a complete beginner (it is my first constructed robot as a hobby – based on Lego Ev3).
My robot is constructed in a way that wheel motors rotate in the opposite direction to the intended front of the robot.
To mitigate I have corrected the wheel orientation in URDF (modifying the copied diffbot example from ros2 control demos). The effect seems correct in the sense that when I test the URDF in rviz and I change the position of the wheel toward “+” values the wheel frames rotate as phical robots does – in the opposite direction where the base link “red” axis point to.
When started Diff Drive Controller and given the command with Twist message linear x: with positive value I was expecting that the DiffDriveController would take into account the change wheel orientation and would generate the negative speed for wheels so the robot goes towards X positive values.
But the DiffDriverConroller behaves as if nothing has been changed in wheel orientation, so the effect is the “real” robot goes backward, while when visualising in rviz the odom frames are incorrectly showing the robot going Forward.
See the screencast – showing that wheels are rotating as physical robot does, but robot moves to opposite direction to the wheels rotation.
DiffBotEv3.webm
As a workaround – I have changed the polarity of the Ev3 motors, but readings from the ev3 sensor still report the rotation as if the polarity has not been changed -so positive speed reports the position increasing in the negative direction. So the effect was that physical robot was driving forward as intended but Odom frames was showing that robot goes opposite direction (I used open_loop parameter as False – so I guess it is because the reported position of the motor as negative)
I’m using the galactic distribution, but have not found in releases notes for master version that anything has been changed in DiffDriveController in that aspect.
Am I missing something or DiffDriveController “hardcodes/assumes” that wheels rotation move always robot forward (I mean positive speed of wheel moves robot always forward) . I have not found anything in the documentation that robot construction must assure the wheels of the robot rotate in a specific way.
How can I resolve my issue (I would prefer not changing the construction of my robot)
I’m a complete beginner (it is my first constructed robot as a hobby – based on Lego Ev3).
My robot is constructed in a way that wheel motors rotate in the opposite direction to the intended front of the robot.
To mitigate I have corrected the wheel orientation in URDF (modifying the copied diffbot example from ros2 control demos). The effect seems correct in the sense that when I test the URDF in rviz and I change the position of the wheel toward “+” values the wheel frames rotate as phical robots does – in the opposite direction where the base link “red” axis point to.
When started Diff Drive Controller and given the command with Twist message linear x: with positive value I was expecting that the DiffDriveController would take into account the change wheel orientation and would generate the negative speed for wheels so the robot goes towards X positive values.
But the DiffDriverConroller behaves as if nothing has been changed in wheel orientation, so the effect is the “real” robot goes backward, while when visualising in rviz the odom frames are incorrectly showing the robot going Forward.
See the screencast – showing that wheels are rotating as physical robot does, but robot moves to opposite direction to the wheels rotation.
DiffBotEv3.webm
As a workaround – I have changed the polarity of the Ev3 motors, but readings from the ev3 sensor still report the rotation as if the polarity has not been changed -so positive speed reports the position increasing in the negative direction. So the effect was that physical robot was driving forward as intended but Odom frames was showing that robot goes opposite direction (I used open_loop parameter as False – so I guess it is because the reported position of the motor as negative)
I’m using the galactic distribution, but have not found in releases notes for master version that anything has been changed in DiffDriveController in that aspect.
Am I missing something or DiffDriveController “hardcodes/assumes” that wheels rotation move always robot forward (I mean positive speed of wheel moves robot always forward) . I have not found anything in the documentation that robot construction must assure the wheels of the robot rotate in a specific way.
How can I resolve my issue (I would prefer not changing the construction of my robot)