For the Ubuntu 20.04 ROS 1 install, go to the ROS1 Noetic setup.
In the GRUB, hit 'e' on the first entry to edit boot parameters. Ubuntu boot needs special parameters for these e485 laptops. Edit the line starting with linux
and add ivrs_ioapic[32]=00:14.0 spec_store_bypass_disable=prctl
to it, so it says something like this:
linux /casper/vmlinuz --- quiet splash ivrs_ioapic[32]=00:14.0 spec_store_bypass_disable=prctl
This is required on every boot. Without these parameters, Ubuntu will be stuck on boot, showing only a cursor on black. To set them to default, first install Ubuntu as usual, reboot (enter boot params again).
Edit the GRUB config. Edit the grub boot file with root rights
sudo nano /etc/default/grub
Modify GRUB_CMDLINE_LINUX_DEFAULT
, copy the parameters above and paste (Ctrl+Shift+V) so it says something like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ivrs_ioapic[32]=00:14.0 spec_store_bypass_disable=prctl"
Finally, update your GRUB config to make these parameters permanent with.
sudo update-grub
Follow the Debian install guide for ROS 2 Jazzy Jalisco
Use the network 'tortugabot' to get internet and a local WiFi. Ask a colleague for the password. The WiFi is available nearby the robot labs.
When connecting the Hokuyo laser sensor via LAN, the connection must be configured manually. This way, the laptop can directly communicate with the LIDAR. Connect the Battery to the Tortugabot to give power to the Hokuyo LIDAR, then connect it via LAN to this laptop. Open Wired Settings and configure the profile. Set IPv4 to Manual and give it an IP and Submask.
The controller can be set up via cable-pairing.
If the Bluetooth client refuses to connect shows a pairing code, disable classic-bond-only. Open up /etc/bluetooth/input.conf
and set the parameter ClassicBondedOnly=false
.
To test the connection, run the joy controller
ros2 run joy joy_node
and listen to the button feedback in another terminal.
ros2 topic echo /joy
Roboclaw complains that you don't have the permission to open 'ttyACM0'. The connection to Roboclaw is only permitted for users who are in the 'dialout' group. Add your user like this:
sudo adduser $USER dialout
Then reboot your PC. Check if the user is in the dialout
group by calling groups
in bash.
Set up new workspace as described in the ROS2 wiki, named tortugabot_ws
https://docs.ros.org/en/jazzy/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html
mkdir -p ~/tortugabot_ws/src
Source the ROS2 build.
source /opt/ros/jazzy/setup.bash
Now set up the workspace with the roboclaw controller code
# go to the src subdirectory cd ~/tortugabot_ws/src
# pull the roboclaw controller git clone -b ros2 https://github.com/code-iai/roboclaw_ros.git
cd ..
# install dependencies rosdep update rosdep install -i --from-path src --rosdistro jazzy -y
# build the workspace
colcon build
# source the build source install/local_setup.bash
Connect the turtle to battery, and USB from the roboclaw to laptop.
Execute the test script in the roboclaw controller https://github.com/code-iai/roboclaw_ros/tree/ros2/roboclaw_node/roboclaw_driver/roboclaw_driver_test.py
ros2 run roboclaw_node test_claw
The wheels should now move a bit.
On first startup it may be stuck. Restart the script.
Make sure the LED on the roboclaw hardware is lit, which indicates a connected battery. If not, change the battery and check the cables. When the roboclaw gets a command the LED quickly blinks with every new input.
If the ROS2 command for the test doesn't work, call the script directly.
python src/roboclaw_node/roboclaw_driver/roboclaw_driver_test.py
Make sure python is at version 3.X with python –version
.
If the socket connection to the roboclaw chip can't be established, check out the 'Roboclaw connection permission section' above.
The Roboclaw Node is now ported to ROS2 Jazzy.
Launch the roboclaw node
ros2 launch roboclaw_node roboclaw_launch.py
Connect the DS3 controller and launch the joy teleop
ros2 launch roboclaw_node joy_teleop_launch.xml
Hold R1 to unlock movement. Left stick is forwards and backwards, right stick is for left and right. The wheels should move only when the sticks are pressed together with R1. When issues arise reboot the roboclaw.
Check the odometry calculation in rviz
rviz2
In Global Options set Fixed Frame from to odom. Add TF to see the broadcast between odom and base_footprint.