turtlebot4: TB4 doesn't move until you go and stand BEHIND!

Robot Model

Turtlebot4 Standard

ROS distro

Jazzy

Networking Configuration

Discovery Server

OS

Ubuntu 24.04

Built from source or installed?

Installed

Package version

Using TurtleBot4 Standard I followed the instructions given in the TurtleBot UserManual Tutorials '4 Generating a Map to generate a map and ‘5 Navigation’ to capture bunch of x, y coordinates (poses) in that map.

In the ‘turtlebot4_python_tutorials’ in the ‘nav_through_poses.py’ I’ve set initial and a couple of capture pose (goal_pose).

In 4 different terminal windows I issue the following commands in that order:

  1. ros2 launch turtlebot4_navigation localization.launch.py map:=/home/udaywavemark/office3.yaml. (this launches the map i captured)
  2. ros2 launch turtlebot4_navigation nav2.launch.py (launches the Nav2)
  3. ros2 launch turtlebot4_viz view_navigation.launch.py (launches RViz to watch what’s happening)
  4. ros2 run turtlebot4_python_tutorials nav_through_poses (the sample code is modified to have my captured poses)

As soon as I issue the 4th command the robot moves for a fraction of second (or the wheels make the sound for a fraction of a second) and then nothing happens. Robot never moves after this.

In the RViz all the status show “active” in green. rosout is quiet.

Now, when I go and stand like one feet “BEHIND” the TB4, it starts moving and then it goes and stops at the FIRST spot specified in the ‘goal_pose’ array. As soon as it reaches that spot it STOPS. Now, once again I go and stand “BEHIND” the TB4 it start to move again and goes to the next spot specified in the ‘goal_pose’ array and so on and forth.

Here one thing to note is that…

  • For the robot to move “there needs to be something less than one feet BEHIND it”
  • The person or the object MUST be BEHIND the robot. Not in FRONT or its SIDEs

It acts as if it needs some kind of persuasion!

I’m using the sample code pretty much “AS IS” (since I found some problems with docking/undocking sequences I removed the code specific to that). I’m not sure what is going on here.

Any help would be very much appreciated.

Here is my ‘nav_through_poses.py’ code:

import rclpy from turtlebot4_navigation.turtlebot4_navigator import TurtleBot4Directions, TurtleBot4Navigator

def main(): rclpy.init()

navigator = TurtleBot4Navigator()

# Start on dock
# if not navigator.getDockedStatus():
#     navigator.info('Docking before intialising pose')
#     navigator.dock()

# Set initial pose
initial_pose = navigator.getPoseStamped([-0.8854837417602539, -0.0904969573020935], TurtleBot4Directions.NORTH)
navigator.setInitialPose(initial_pose)

# Wait for Nav2
navigator.waitUntilNav2Active()

# Set goal poses
goal_pose = []
goal_pose.append(navigator.getPoseStamped([-1.2812573909759521, -7.930064678192139], TurtleBot4Directions.EAST))
goal_pose.append(navigator.getPoseStamped([1.340737223625183, 1.492254614830017], TurtleBot4Directions.NORTH))

# Undock
#navigator.undock()

# Navigate through poses
navigator.startThroughPoses(goal_pose)

# Finished navigating, dock
#navigator.dock()

rclpy.shutdown()

if name == ‘main’: main()

Type of issue

Navigation (SLAM, Nav2 etc.)

Expected behaviour

Once map is launched and the coordinates are correct TB4 navigation should work.

Actual behaviour

TB4 never moves “unless someone go and stand BEHIND it”.

Error messages


To Reproduce

  1. Launch captured map
  2. Launch Nav2
  3. Launch RViz to view (this step is optional)
  4. Run ‘nav_through_poses’

Other notes

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 16 (1 by maintainers)

Most upvoted comments

@slowrunner @UdayWaveMark My understanding at this point in the conversation that there are now both local and global costmaps being generated but you are still seeing an odd behaviour that the robot will not drive when you expect it should.

I am going to start by responding about the map saving queries. We do recommend running nav2 (including slam and localization) on a computer because an offboard computer tends to have more resources available and is more likely to be able to keep up with the needs of nav2 / less likely to cause timeout and/or reliability issues, particularly with the mapping process. That being said, when using the offboard computer for navigation you need to make sure it is time synced properly with the robot.

I copied (scp) the home1.yaml and home1.pgm files to RPi and tried running the localization there. Since these files are created on my pc (not on the RPi) I get an error referring to the local folder (/home/udaywavemark/home1.yaml). I opened and looked at the ‘home1.yaml’ file to change the path (location) to reflect RPi. But that file doesn’t have any path info. So, I assume the path must be stored in the ‘home1.pgm’ file. Since ‘home1.pgm’ is not a text file, I can’t monkey with the path stored in that.

You correctly identified the files that you need to move onto the robot to run localization from there. There is no path information within those files, and probably that issue you are seeing is because you didn’t change the path you provided in your launch command (ros2 launch turtlebot4_navigation localization.launch.py map:=/home/udaywavemark/home1.yaml). You need to update the path in your launch command to point at where you placed these maps on the robot. The pgm file is in fact just a simple grayscale image file, that is editable with image editors although if you modify it in certain ways then you also need to modify the yaml to match.

Now back to my original issue… the TB4 still doesn’t move until I go and stand behind it. Here I have attached all the relevant log files.

Looking through the nav2 log I agree with @slowrunner that this is your main culprit: [planner_server-3] [WARN] [1739807041.867504300] [planner_server]: GridBased plugin failed to plan from (-0.16, -0.05) to (5.25, -1.72): "Goal Coordinates of(5.254720, -1.718283) was outside bounds" This suggests to me that you have directed the robot to drive to a location that is off the edge of your map. This is usually a result of misunderstanding where the origin is or the overall size of the map and the units in use. Using the publish point command that they mentioned is a good way to understand how the coordinates are laid out on your map.

Beyond this there do seem to be a lot of time sync issues that are popping up so either make sure that both your offboard computer and robot are both being synced properly to the ubuntu time servers (ideally prior to launching nav) or timesync the robot directly to your offboard computer.

If you want to better understand what is happening when you stand behind the robot etc and/or are still having issues, then I would suggest replicating all of that and sharing the full logs again, ideally also with a visual recording from rviz.

replace all use_sim_time: true with use_sim_time: false

Going back up to this modification that you made in order to get the costmaps to show up: This should not be necessary since it is set to false in the launch file which should override the yaml. You folks finding it necessary does suggest to me that there could be a bug that needs to be addressed. @slowrunner I am counting on you to continue this part of the discussion with me on your discussion post.

Ps. I am sorry that you have not gotten direct support from Clearpath up until now. Unfortunately there are large (paying) customers that end up taking the attention of the support team and can result in delayed support here. I am glad that you guys have been able to look into so much over the holiday weekend.

@slowrunner ,

I followed the steps “as is” and now I see the costmaps! Also, I read the whole #501 issue (that you mentioned and gave credit for) and I still don’t understand how you got this tip from that! The reason why i’m mentioning this explicitly is that “Before I posted this issue I already have read #501 issue” and decided it is not relevant. So, if you could tell me from $501 how you managed to find some relevance to your #549 issue, that would be a big help.

I copied (scp) the home1.yaml and home1.pgm files to RPi and tried running the localization there. Since these files are created on my pc (not on the RPi) I get an error referring to the local folder (/home/udaywavemark/home1.yaml). I opened and looked at the ‘home1.yaml’ file to change the path (location) to reflect RPi. But that file doesn’t have any path info. So, I assume the path must be stored in the ‘home1.pgm’ file. Since ‘home1.pgm’ is not a text file, I can’t monkey with the path stored in that.

To generate / save a map I run ‘slam_toolbox’ and ‘rviz’. Both on my pc (MacBook) Virtual environment. When I save the map, it gets saved in my pc.

In one of your comments you asked me to try running the ‘localization’ and ‘navigation’ from RPi and run ‘rviz’ from the pc. So, if you run ‘rviz’ on your pc then, when you save the map it would save with the local path info (in my case ‘/home/udaywavemark’). On the other hand when I ssh into RPi it goes to ‘/home/ubuntu’ on RPi. So, I’m wondering how would you resolve this path issue? (Generate and Save map in Virtual environment, later run localization and navigation from RPi).

I could install Rviz in my RPi and run ‘slam_toolbox’ and ‘RViz’ from there and save the map in there itself. But you’re doing it differently. So, I would like to know how you do that.

Now back to my original issue… the TB4 still doesn’t move until I go and stand behind it. Here I have attached all the relevant log files.

localization_logs.txt

nav2_logs.txt

rviz_logs.txt

@slowrunner ,

Wow! there is a lot of feedback! Thank you very much. Couple of things…

I was running ‘Localization’ and ‘Nav2’ on my ‘remote desktop / laptop’. Not from the RPi. Wondering whether this is the reason why rviz2 is not showing the local or global costmap? Today I will do as you suggested (run the Localization and Nav2 from RPi)

Image

When I issue ‘date’ command on the ‘remote laptop’ and ‘RPi’ i get pretty much the same time (1 second difference that maybe because i’ve opened two terminals and switching from one to another to issue these commands).

I looked into the Create 3 logs and I believe the there is no (not significant) delay in the ntpd:

Image

Another question - did you do the reset to clear out the WiFi connection? You want all ROS sensor topics only going across the USB-Ethernet connection, not some over the USB-C cable and some over WiFi.

I really don’t understand this. What do you mean by it? How do i validate this? How can i configure it to channel this correct?

This shows localization is working.

I can’t see the image you attached before the comment. So, I don’t know what made you say that.

Today I will create a map of a very small area that doesn’t involve any carpeting. Earlier I myself don’t remember while creating the map whether I went slow, turned as little as possible etc., This time while mapping a small area I will just follow you suggestions and see whether that makes any difference.

One thing real quick… with my previous maps and logs (that I’ve added here), though you found lot of discrepancies, the robot managed to go to all the 3 poses (specified in the nav_through_poses). But for it to move “I had to go and stand behind it at every pose”.

Yeah but we’re not paying the support personnel salaries either!

I really thought Rusty and smatar are Clearpath Robotics folks.

Logs from: ros2 launch turtlebot4_viz view_navigation.launch.py

rviz_logs.txt

Logs from: ros2 launch turtlebot4_navigation nav2.launch.py

nav2_logs.txt

Logs from: ros2 launch turtlebot4_navigation localization.launch.py map:=/home/udaywavemark/home1.yaml

localization_logs.txt

@slowrunner ,

As a newbie (to ROS2 / TB4) lot of the stuff you mentioned is way over my head. But, except you I’m not getting any answers or help from anyone. Here I’m attaching the ‘base map’, ‘cost map’, and relevant log files.

When you have time please take a look and see whether your assumptions are correct or it is all together something else.

Tagging @RustyCPR , @smatarCPR to keep them in loop.

Image Image

@slowrunner Thank you for the suggestion (rather a hack!). I now have edited my original post with appropriate / relevant information and cleaned up the content.

@UdayWaveMark Until they add the Jazzy and Ubuntu 24.04 options to the troubleshooting template, you can choose something just like you did, finish and press submit, then go back and edit your troubleshooting issue, replacing the wrong answers with Jazzy and 24.04.