ROBOTIS-GIT / turtlebot3

ROS packages for Turtlebot3
http://turtlebot3.robotis.com
Apache License 2.0
1.51k stars 1.03k forks source link

Turtlebot velocity is not updating #1028

Closed Faheemibrahim closed 3 months ago

Faheemibrahim commented 3 months ago

ISSUE TEMPLATE ver. 0.4.0

  1. Which TurtleBot3 platform do you use?

    • [x] Waffle Pi
  2. Which ROS is working with TurtleBot3?

    • [x] (ROS2 humble hawksbill)
  3. Which SBC(Single Board Computer) is working on TurtleBot3?

    • [x] Raspberry Pi 4 B
  4. Which OS you installed on SBC?

    • [x] Ubuntu Server 22.04.4 LTS (Jammy Jellyfish)
  5. Which OS you installed on Remote PC?

    • [x] Ubuntu Desktop 22.04.4 LTS (Jammy Jellyfish)
  6. Specify the software and firmware version(Can be found from Bringup messages)

    • Software Version: 2.1.5 (TurtleBot3 ROS Packages)
    • Firmware Version: V230127R1 (opencr board)
  7. Specify the commands or instructions to reproduce the issue. ros2 launch turtlebot3_bringup robot.launch.py ros2 run turtlebot3_teleop teleop_keyboard ros2 topic list /joint_states ros2 topic echo /odom

  8. Copy and Paste the error messages on terminal.

image

  1. Please describe the issue in detail. Problem Description
yigitboracagiran commented 3 months ago

Can you share us your cpp file which you printing this output?

Faheemibrahim commented 3 months ago

i have added the content in these files

launch and yaml files launch_file.txt waffle_pi_yaml.txt

.cpp files

Please let me know if you need anything else, and I really appreciate your help !!

yigitboracagiran commented 3 months ago

I didn't understand what you're trying to do with this. But did you try to download turtlebot3_simulation from this address and launch it? Odom topic and your twist data most likely will come in simulation... After you complete this, we can go step by step...

yigitboracagiran commented 3 months ago

Don't forget to put this repository to your workspace build with colcon build

Faheemibrahim commented 3 months ago

I am working with a physical TurtleBot3 robot and have cloned the TurtleBot3 repository, specifically the release 2.1.5 https://github.com/ROBOTIS-GIT/turtlebot3/releases/tag/2.1.5 from GitHub, which is built for ROS 2 Humble. After cloning, I used colcon to build the workspace on the Raspberry Pi. To bring up the robot, I executed the following command on the Raspberry Pi ros2 launch turtlebot3_bringup robot.launch.py

Then, from my laptop, I used the teleop package to control the robot. While the robot was moving, I monitored the odometry data by running: ros2 topic echo /odom but i dont see it updating the velocity values. in simulation everything is working fine

yigitboracagiran commented 3 months ago

Did you check the frames?

ros2 run tf2_tools view_frames

Faheemibrahim commented 3 months ago

frames_2024-08-09_14.55.02.pdf yup heres an image image

yigitboracagiran commented 3 months ago

I didn't work on physical turtlebot3, do you still need to export to turtlebot3 model? Maybe you exported the wrong one?

Faheemibrahim commented 3 months ago

No worries, I believe the turtlebot3 waffle_pi.Urdf is properly used when I launch the turtlebot_bringup. so I don’t think the issue is with it opening the wrong urdf. Could there be a problem with the urdf ? The picture below shows the waffle_pi.urdf being used image

yigitboracagiran commented 3 months ago

I see, what about coordinate information? Are they coming or not ( like velocity data ) with /odom topic? And what about other topics? For example is /cmd_vel coming true?

Faheemibrahim commented 3 months ago

The topic updates the the Linear twist and angular twist but the covariance is not updating. Will that be an issue if I use slam or nav2 ? and yes the /cmd_vel updates perfectly image

yigitboracagiran commented 3 months ago

Is /odom topic successfully publish the points? If not, there is a problem with /odom topic's itself

Faheemibrahim commented 3 months ago

image i zoomed out and found this is this how it should be updating ? do you think its working fine ?

yigitboracagiran commented 3 months ago

Can you run ros2 topic echo /odom --no-arr in a new terminal next to your bringup and teleop nodes? You can see the robot coordinates in the terminal... Does it coming true or not?

Faheemibrahim commented 3 months ago

The coordinates are being published correctly but for some reason it starts at x =26 and y = 14 and the z updates properly.

yigitboracagiran commented 3 months ago

Can you reboot the robot? If it still starts at (26, 14) probably there are initialize values in a launch file. Can you check please?

Faheemibrahim commented 3 months ago

Rebooting it didnt fix the values but physically turning it off and rebooting as you suggested worked. So is the odom fine ?

yigitboracagiran commented 3 months ago

Yes it's looks like it

yigitboracagiran commented 3 months ago

If odom coordinates and cmd_vel topics are coming true, linear and angular velocity in /odom should be fine also. Can't you use /cmd_vel in your code instead of using velocities in /odom for now until we figuring it out why the velocity data is coming wrong in /odom?

Faheemibrahim commented 3 months ago

Thank you for looking into this issue and being patient with me. may god bless you bro !!

Faheemibrahim commented 3 months ago

I thought odom data publishes everything. i just starting learning ros and was trying to make my own control system to experiment and I thought it was important for the odom to publish velocities and thought it wasn’t working.

Faheemibrahim commented 3 months ago

So odom only publishes coordinates ? And I use cmd_vel to track the velocity ?

yigitboracagiran commented 3 months ago

Exactly, best way to track velocity is subscribing velocity topic, in our case subscribing /cmd_vel

Faheemibrahim commented 3 months ago

Honestly man you’re the best thank you !!