Fork of linorobot2. This repository holds FRU's modifications that are proprietary to the FRU-bot. The FRU-bot consists of an lds-01 2D lidar, MPU 6050, TT motors, dual L298N motor-driver, IR speed sensor, and ESP32-WROOM-DevKitC. Power is delivered via a custom pcb board consisting of 7.4V, 5V, and 3.3V headers for fascilitated attachment of hardware interfaces. The robot chassis was sourced from an external party on printables; although, the final chassis height was lowered for improved kinematics. Agent is intended to run on a remote docker container communicating wirelessly with esp32, but manual installation instructions are available.
- Recommended installation via installation script.
- Creates ros2 workspace in $HOME/FRU_ws by default.
- Assumes docker in sudo usr group to pull micro-ROS agent docker image.
source /opt/ros/<ros_distro>/setup.bash cd /tmp wget https://raw.githubusercontent.com/FreedomRoverUnits/FRU-bot/humble/install_FRU_bot.bash bash install_FRU_bot.bash <FRU_bot_ws> source ~/.bashrc
For Simulation steps skip to step 3.
-
Connect to robot wifi.
-
Start micro-ros agent via docker in another terminal.
source /opt/ros/<your_ros_distro>/setup.bash docker run -it --rm --net=host microros/micro-ros-agent:humble udp4 --port 8888 -v6
-
Start EKF node and joint state publisher, set rviz flag to true to visualize robot description. Creates namespace "FRU_bot0" for all topics to be published under (except /tf topics, must set remap_tf to True).
source install/setup.bash ros2 launch fru_bot_bringup bringup_default.launch.py rviz:=true use_loc:=True use_ns:=True idx:=0
Or for simulation:
ros2 launch fru_bot_bringup bringup_default.launch.py rviz:=true use_ns:=True idx:=0 sim:=True
-
Control the robot manually via teleop twist commands.
python3 teleop_twist_keyboard_FRU.py --agents 1
- Run SLAM toolbox.
ros2 launch fru_bot_navigation slam.launch.py rviz:=true
- Move the robot to build the map, and save it.
cd fru_bot/fru_bot_navigation/maps ros2 run nav2_map_server map_saver_cli -f <map_name> --ros-args -p save_map_timeout:=10000.
- First change MAP_NAME in navigation.launch.py to the name of the map you created. Or change it dynamically.
cd <robot_ws> colcon build ros2 launch fru_bot_navigation navigation.launch.py map:=<path_to_map_file>/<map_name>.yaml
- Run Nav2 package.
ros2 launch fru_bot_navigation navigation.launch.py
Optional parameter for loading maps:
- map - Path to newly created map <map_name.yaml>.
Optional parameters for simulation on host machine:
- sim - Set to true for simulated robots on the host machine. Default value is false.
- rviz - Set to true to visualize the robot in RVIZ. Default value is false.
navigation.launch.py will continue to throw this error - 'Timed out waiting for transform from base_link to map to become available, tf error: Invalid frame ID "map" passed to canTransform argument target_frame - frame does not exist' until the robot's pose has been initialized.
- Refer to Nav2 tutorial for more info.
Troubleshooting Guide (Directly from linorobot2)
1. The changes I made on a file are not taking effect on the package configuration/robot's behavior.
-
You need to build your workspace every time you modify a file:
cd <ros2_ws> colcon build #continue what you're doing...
- Try to up
transform_timeout
by 0.1 in fru_bot_navigation/config/slam.yaml until the warning is gone.
- Check your <robot_type>.properties.urdf.xacro and ensure that there's no syntax errors or repeated decimal points.
-
Don't forget to update the microROS agent as well after your updates. Just run:
bash update_microros.bash