turtlebot / turtlebot4

Turtlebot4 common packages.
Apache License 2.0
105 stars 47 forks source link

Cannot run Launch Files on Turtlebot4 Lite #114

Closed rohanchandra-cpe closed 1 year ago

rohanchandra-cpe commented 1 year ago

Please provide the following information:

To Reproduce Provide the steps to reproduce:

  1. Power on the Turtlebot4 (raspberry pi was previously set up to connect to a 5GHz network via wifi.sh)
  2. Go to :8080 and connect the Create3 to a 2.4GHz network
  3. Follow https://turtlebot.github.io/turtlebot4-user-manual/tutorials/first_node_python.html until "Test Create3 Button1 "
  4. Run "ros2 run turtlebot4_python_tutorials turtlebot4_first_python_node"
  5. Press Button 1 on the Create3

Other notes I am currently attempting to follow the guide for the Turtlebot 4 lite. Specifically the "Creating your first node (Python)" section: https://turtlebot.github.io/turtlebot4-user-manual/tutorials/first_node_python.html. I get to the point where I need to run "ros2 run turtlebot4_python_tutorials turtlebot4_first_python_node." However, nothing happens when I press the first button on the Create3. Instead, when I CTRL+C out of the command, I get the error attached. I have connected the Raspberry Pi to a 5GHz network (wifi.sh) and the Create3 to a 2.4 GHz network. Please let me know how I can resolve this, Thanks!

main_ros_error

roni-kreinin commented 1 year ago

@rohanchandra-cpe Can you call ros2 topic list and paste the output here?

rohanchandra-cpe commented 1 year ago

Sure thing. The second image is from my normal Ubuntu environment, and the first image was taken after ssh'ing into the raspberry pi. Should I be doing all of my development inside the Raspberry Pi?

I set up my workspace and did the first Python node exercise outside of the Raspberry Pi, for reference.

ros2topicechoraspberrypissh ros2topiclistoutside

roni-kreinin commented 1 year ago

@rohanchandra-cpe It looks like there may be some networking issues going on.

Can you confirm that the Create 3 is connected to Wi-Fi by going to the webserver and checking the "Connect" tab? It should display the IP address if connected like this: image

If there is no IP address, try connecting the Create 3 again by following these instructions.

It also looks like your PC cannot see the RPi topics. Can you make sure you are using the same ROS_DOMAIN_ID on both, and call ros2 multicast receive on your PC, followed by ros2 multicast send on the RPi to check that multicast packets aren't being blocked by your network?

Regarding development, you should be able to run the tutorial python node on either your PC or the RPi once all of the nodes can communicate with each other properly.

rohanchandra-cpe commented 1 year ago

rosmulticasrsend rosdomainids Ok, I ran the tests you wanted me to above:

  1. An IP address does appear, so it looks like my Create 3 is connected
  2. the second image shows the result of searching for the ros domain ids. RPI on left, PC on right
  3. the first image shows what happens when I did a ros2 multicast receive on my PC, followed by a ros2 multicast send on the RPI (RPI left, PC right). Nothing happened for about 15 seconds after I did the send command, so I did a CTRL+C on the right and I get that error message.
roni-kreinin commented 1 year ago

@rohanchandra-cpe Are you running the robot on a university or corporate network? It's possible that your network blocks multicast packets over Wi-Fi which is used for discovery.

If your network is blocking multicast packets, I would recommend following these instructions to configure your robot to use the FastDDS discovery server.

rohanchandra-cpe commented 1 year ago

I am on my home network. We have a 5.0Ghz network and 2.4Ghz network. I have connected the former to the Raspberry Pi and the latter to the Create 3. According to the WiFi that I used to set up the RPi (wifi.sh), it should support multicast (image below).

wifi0

roni-kreinin commented 1 year ago

Your Wi-Fi interface will support multicast, but your router may still block those packets. You can try going to your router gateway and looking for any multicast settings.

rohanchandra-cpe commented 1 year ago

Ok, I'm going to try following the FastDDS instructions and see if that makes a difference. I'll let you know. Thanks!

rohanchandra-cpe commented 1 year ago

The FastDDS instructions are not working for me. I get up to the point where I need to run

sudo systemctl daemon-reload sudo systemctl enable ip_route.service sudo systemctl start ip_route.service

And I get the error below.

rosfastddserror

I am running WSL 1.0.3.0. Also, I ran "wsl ~" within the powershell and then run the above commands. I was following this link to try and resolve these issues: https://askubuntu.com/questions/1379425/system-has-not-been-booted-with-systemd-as-init-system-pid-1-cant-operate

roni-kreinin commented 1 year ago

@rohanchandra-cpe Instead of running the ip_route service, you can manually add the ip route by calling sudo ip route add 192.168.186.0/24 via xxx.xxx.xxx.xxx, replacing the x's with your RPi IP address. You can add this line to your ~/.bashrc file to have it run every time a new terminal is opened.

rohanchandra-cpe commented 1 year ago

That did not work either. rosiproute I also tried with 192.168.001.171 and that didn't work either. Is there any other information I can give you to help resolve this error?

rohanchandra-cpe commented 1 year ago

Also @roni-kreinin , I already have that exact line you suggested I run in /usr/local/sbin/ip_route.sh on the remote PC.

rosuserlocalbin

roni-kreinin commented 1 year ago

@rohanchandra-cpe Can you paste the output of ip a?

rohanchandra-cpe commented 1 year ago

@roni-kreinin There appears to be some sensitive information in that output. Is there anything specifically you want to see?

roni-kreinin commented 1 year ago

Your Wi-Fi interface. You may need to call something like sudo ip route add 192.168.186.0/24 via 192.168.1.171 dev wlan0, replacing wlan0 with your interface name.

rohanchandra-cpe commented 1 year ago

This is what I currently see after starting a fresh new terminal. I added the above line to my ~/.bashrc file, and it did not cause any errors when I ran it initially.

image

At one point the robot started driving towards the docking station when I pressed the button with 2 dots on it, but that does not work right now. Am I missing some additional set up steps?

Also, just as an aside, is there any documentation about what the different colors from the light ring mean?

roni-kreinin commented 1 year ago

Can you make sure that you can ping the Create 3 from your PC by calling ping 192.168.186.2? Also try calling ros2 daemon stop before calling ros2 topic list. You may need to call ros2 topic list a couple of times to get the topics to show up. Also, SSH into the RPi and check that you can list the topics there.

Lightring states are shown here.

rohanchandra-cpe commented 1 year ago

I am able to ping that IP address. I also did a ros2 daemon stop before calling ros2 topic list. However, nothing has appeared in the ros2 topic list output in neither the RPi nor my remote PC. I only see /parameter_events and /rosout

rohanchandra-cpe commented 1 year ago

By the way, I do not see an IP address in the online portal for the Create 3. Is this an issue, or to be expected from a FastDDS setup?

image

roni-kreinin commented 1 year ago

Yes, the Create 3 should not be connected to Wi-Fi for the discovery server setup. Communication with it will be purely over USB-C. That is why we have to add the ip route on your PC.

Lets check a few configurations in your setup to figure out what the issue is. If you could paste the following settings that would be great.

Create 3:

RPi4:

PC:

rohanchandra-cpe commented 1 year ago

image

image

/etc/sysctl.conf image

/etc/turtlebot4_discovery/setup.bash image

/etc/turtlebot4_discovery/discovery_super_client.xml image

systemctl stuff image

roni-kreinin commented 1 year ago

The systemctl status is showing a time jump from when the services were started. When you call date on your robot, does it display the correct time and date?

Also can you run htop and check that the CPU's are not being maxed out?

rohanchandra-cpe commented 1 year ago

Hey, sorry for the delay @roni-kreinin . Here are the screenshots you asked for.

date appears to show the correct time and date: image

And here is htop on the robot: image

rohanchandra-cpe commented 1 year ago

@roni-kreinin I am still struggling with this issue. When you get a chance please see the information I attached above. Thank you

roni-kreinin commented 1 year ago

Can you try stopping the turtlebot4 service with sudo systemctl stop turtlebot4, then restarting the discovery server service with sudo systemctl restart discovery. Once it has restarted, manually launch the turtlebot4 nodes with ros2 launch turtlebot4_bringup lite.launch.py. Then, open a new terminal in the RPi and run ros2 daemon stop, then ros2 topic list. You may need to run ros2 topic list twice to get a full list of available topics.

rohanchandra-cpe commented 1 year ago

image

@roni-kreinin I did everything you asked for. The screenshot is from the second Rpi terminal you asked me to make. It looks like I got all the topics at first, but then with multiple "ros2 topic list" calls it went away.

Also, if it helps, this is the result of running ros2 launch turtlebot4_bringup lite.launch.py (sorry it is so small) image

roni-kreinin commented 1 year ago

@rohanchandra-cpe There is likely some configuration that is missing, though I am not seeing anything wrong. Would you be interested in updating to Humble? There is a new setup tool that takes care of all this configuration automatically.

See https://turtlebot.github.io/turtlebot4-user-manual/setup/discovery_server.html#robot

rohanchandra-cpe commented 1 year ago

@roni-kreinin hey, sorry for the lapse in responses, been busy with work. Since we last talked I have upgraded my Create3 to Humble 1.0, and I have attempted to update my RPi from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS. This morning I was able to ssh in just fine and confirm that the upgrade worked, however, I ran a sudo reboot (following this link: https://github.com/turtlebot/turtlebot4_setup) and now I can no longer SSH in.

image

I also cannot access the website for the Create3

rohanchandra-cpe commented 1 year ago

@roni-kreinin If I wanted to factory reset the turtlebot4 and start all of the setup from scratch, how would I do that? Also, do you think that would be a good idea?

roni-kreinin commented 1 year ago

@rohanchandra-cpe Did you update the RPi4 to Ubuntu 22.04 manually? Or did you use a humble image from http://download.ros.org/downloads/turtlebot4/?

rohanchandra-cpe commented 1 year ago

I upgraded it manually.

sudo apt update sudo apt upgrade sudo apt dist-upgrade sudo apt autoremove sudo do-release-upgrade

roni-kreinin commented 1 year ago

Can you try to follow https://turtlebot.github.io/turtlebot4-user-manual/setup/basic.html#install-latest-raspberry-pi-image to install the official humble image?

rohanchandra-cpe commented 1 year ago

Will I need to ssh into the rpi and do this, because if so, I currently cannot ssh into it. The old IP address I used to ssh to does not work anymore. And if I try to ping it, I just get "Destination Host Unreachable"

roni-kreinin commented 1 year ago

No, you will have to remove the SD card from the RPi and flash it with a new image. Note that this will overwrite all data on the SD card, so save any changes you have made before doing so.

rohanchandra-cpe commented 1 year ago

Ok, I'll do that and let you know how it goes. Thanks!

rohanchandra-cpe commented 1 year ago

image

It said there wasn't enough space on the microsd for the pi. I noticed a lot of these files above that all have the same date (3/20/23), which is when I did the manual upgrade. Can I safely delete these?

roni-kreinin commented 1 year ago

Where are you seeing this error?

rohanchandra-cpe commented 1 year ago

Within the file explorer itself image

roni-kreinin commented 1 year ago

You can't just move the file onto the SD card. You need to image the card with a tool like dcfldd. Do you have access to a linux machine that you can insert the SD card into?

rohanchandra-cpe commented 1 year ago

Ah yes, sorry. I do. Thanks!

rohanchandra-cpe commented 1 year ago

image

I see /dev/sda even when I don't insert the SD Card. Nothing seems to change here when I do insert it (the image is the output of sudo fdisk -l)

roni-kreinin commented 1 year ago

Is this running on a VM?

rohanchandra-cpe commented 1 year ago

I'm on a Windows PC. I downloaded "Ubuntu 22.04 LTS" from the windows store. That is what this is

rohanchandra-cpe commented 1 year ago

This is what I see on the Powershell: The D: is my SD Card image

roni-kreinin commented 1 year ago

I'm not too familiar with WSL but you can try following a tutorial like this to mount the SD card. https://learn.microsoft.com/en-us/windows/wsl/wsl2-mount-disk

rohanchandra-cpe commented 1 year ago

@roni-kreinin I flashed the Humble image onto the Raspberry Pi SD Card and put it back on the bot. I was able to run "turtlebot4-setup" and I connected it to my 5Ghz network. However, I am still not able to see the /ip topic

image

The top window is what happened after I finished running the setup tool. I think the RPI rebooted twice, but that top terminal has not changed at all. The bottom terminal shows what happened after I tried calling "ros2 topic echo /ip"

rohanchandra-cpe commented 1 year ago

@roni-kreinin Also, this is what happened when I tried to ping the IP that the RPi used to be on, and SSH in

image

roni-kreinin commented 1 year ago

Run the suggested ssh-keygen command in the warning message, then try to ssh again.

roni-kreinin commented 1 year ago

The top window is what happened after I finished running the setup tool. I think the RPI rebooted twice, but that top terminal has not changed at all. The bottom terminal shows what happened after I tried calling "ros2 topic echo /ip"

The ssh session will freeze because the RPi has changed networks. You can close that terminal.

rohanchandra-cpe commented 1 year ago

Ok, I was able to ssh into it. What should I do from here?