Skip to content

HMC03/linorobot2-autonomous-nav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linorobot2 Autonomous Navigation

This project leverages the Linorobot2 platform and the Nav2 framework to implement autonomous navigation and affective mapping in dynamic, unstructured environments. Our goal is to enable a simple four-wheeled robot to intelligently explore hazardous areas, build a map using SLAM, and navigate safely without human intervention. By integrating perception, planning, and control within a Dockerized ROS2 environment, this project demonstrates practical applications of robotics software and highlights the potential of autonomous systems in real-world, high-risk scenarios.

Project Video

Docker Instructions

  1. Build Docker Image:
docker build -f <DockerfileName> -t <YourDockerImage:Tag> .
  1. Create & run docker container from image:
xhost +local:root &&
docker run -it --rm \
            -e DISPLAY=$DISPLAY \
            -e QT_X11_NO_MITSHM=1 \
            -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
            --device=/dev/dri \
            --privileged \
            <YourDockerImage:Tag> 
  1. open container in different window:
docker exec -it <ContainerID> bash

#Note: Find the ID or name using: docker ps

Working Inside the Docker Container

Linorobot2 Simple Instructions

  1. Start Gazebo with 4WD base in Building.world: ros2 launch linorobot2_gazebo gazebo.launch.py robot_base:=4wd use_sim_time:=true world:=/ros2_ws/src/worlds/Building.world

  2. Start RViz with robot description and TF: ros2 launch linorobot2_description description.launch.py rviz:=true use_sim_time:=true

    Optional(Gazebo does this): Launch EKF for Odometry Fusion: ros2 launch linorobot2_navigation ekf.launch.py use_sim_time:=true


SLAM (Map Creation)

  1. Start SLAM Toolbox to build a map: ros2 launch slam_toolbox online_async_launch.py

  2. Drive the robot manually using teleop (in a separate terminal): ros2 run teleop_twist_keyboard teleop_twist_keyboard Note: Explore the map fully before saving

  3. Save the generated map: ros2 run nav2_map_server map_saver_cli -f /ros2_ws/src/maps/map


Autonomous Navigation (Using Saved Map)

  1. TEMPORARILY publish a static transform from map to odom (required to use 'map' as the fixed frame in RViz): ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 map odom

  2. Launch the full Nav2 stack with your saved map: ros2 launch nav2_bringup bringup_launch.py map:=/ros2_ws/src/maps/map.yaml use_sim_time:=true

  3. In RViz:

    • Use the "2D Pose Estimate" tool to set the robot's rough location on the map.
    • Make sure the "Fixed Frame" is set to "map".
  4. In RViz:

    • Use the "Nav2 Goal" (2D Nav Goal) tool to send a destination on the map.
    • Watch the robot navigate autonomously!

Notes:

  • Run each launch command in a separate terminal inside the container.
  • Ensure Gazebo and RViz have access to your display (e.g., use -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix when running the container).
  • If AMCL reports pose errors, ensure the initial pose is in the "map" frame and simulation time is being used.

About

Dockerized ROS2 Humble simulation with SLAM Toolbox + Nav2 for 4WD mapping and goal navigation. Enables interactive pickup/dropoff with robotic arm control via user-defined waypoints.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors