GithubHelp home page GithubHelp logo

blackcoffeerobotics / bcr_bot Goto Github PK

View Code? Open in Web Editor NEW
125.0 4.0 26.0 9.63 MB

A Gazebo-ROS AMR robot with differential drive, depth camera, IMU and 2D LiDAR

Home Page: https://blackcoffeerobotics.com/blog/migration-from-gazebo-classic-to-ignition-with-ros-2

License: Apache License 2.0

CMake 1.29% Dockerfile 5.09% Python 93.62%
gazebo-ros gazebo-simulator ignition-gazebo ignition-robotics ros ros2 ros2-humble gz gazebosim robotics

bcr_bot's Introduction

New BCR Robot

amr_showcase_navigation.mp4

About

This repository contains a Gazebo simulation for a differential drive robot, equipped with an IMU, a depth camera, stereo camera and a 2D LiDAR. The primary contriution of this project is to support multiple ROS and Gazebo distros. Currently, the project supports the following versions -

  1. ROS Noetic + Gazebo Classic 11 (branch ros1)
  2. ROS2 Humble + Gazebo Classic 11 (branch ros2)
  3. ROS2 Humble + Gazebo Fortress (branch ros2)
  4. ROS2 Humble + Gazebo Harmonic (branch ros2)

Each of the following sections describes depedencies, build and run instructions for each of the above combinations

Noetic + Classic (Ubuntu 20.04)

Dependencies

In addition to ROS1 Noetic and Gazebo Classic installations, the dependencies can be installed with rosdep

# From the root directory of the workspace. This will install everything mentioned in package.xml
rosdep install --from-paths src --ignore-src -r -y

Source Build

catkin build --packages-select bcr_bot

Binary Install

To install BCR bot in the binaries:

sudo apt-get install ros-noetic-bcr-bot

Run

To launch the robot in Gazebo,

roslaunch bcr_bot gazebo.launch

To view in rviz,

roslaunch bcr_bot rviz.launch

Configuration

The launch file accepts multiple launch arguments,

roslaunch bcr_bot gazebo.launch 
	camera_enabled:=True \
	two_d_lidar_enabled:=True \
	position_x:=0.0 \
	position_y:=0.0 \
	orientation_yaw:=0.0 \
	odometry_source:=world \
	world_file:=small_warehouse.world \
	robot_namespace:="bcr_bot"

Note: To use stereo_image_proc with the stereo images excute following command:

ROS_NAMESPACE=bcr_bot/stereo_camera rosrun stereo_image_proc stereo_image_proc

Humble + Classic (Ubuntu 22.04)

Dependencies

In addition to ROS2 Humble and Gazebo Classic installations, we need to manually install gazebo_ros_pkgs (since the same branch supports Classic and Fortress)

sudo apt-get install ros-humble-gazebo-ros-pkgs

Remainder of the dependencies can be installed with rosdep

# From the root directory of the workspace. This will install everything mentioned in package.xml
rosdep install --from-paths src --ignore-src -r -y

Source Build

colcon build --packages-select bcr_bot

Binary Install

To install BCR bot in the binaries:

sudo apt-get install ros-humble-bcr-bot

Run

To launch the robot in Gazebo,

ros2 launch bcr_bot gazebo.launch.py

To view in rviz,

ros2 launch bcr_bot rviz.launch.py

Configuration

The launch file accepts multiple launch arguments,

ros2 launch bcr_bot gazebo.launch.py \
	camera_enabled:=True \
	two_d_lidar_enabled:=True \
	stereo_camera_enabled:=False \
	position_x:=0.0 \
	position_y:=0.0 \
	orientation_yaw:=0.0 \
	odometry_source:=world \
	world_file:=small_warehouse.sdf \
	robot_namespace:="bcr_bot"

Note: To use stereo_image_proc with the stereo images excute following command:

ros2 launch stereo_image_proc stereo_image_proc.launch.py left_namespace:=bcr_bot/stereo_camera/left right_namespace:=bcr_bot/stereo_camera/right

Humble + Fortress (Ubuntu 22.04)

Dependencies

In addition to ROS2 Humble and Gazebo Fortress installations, we need to manually install interfaces between ROS2 and Gazebo sim as follows,

sudo apt-get install ros-humble-ros-gz-sim ros-humble-ros-gz-bridge ros-humble-ros-gz-interfaces 

Remainder of the dependencies can be installed with rosdep

# From the root directory of the workspace. This will install everything mentioned in package.xml
rosdep install --from-paths src --ignore-src -r -y

Source Build

colcon build --packages-select bcr_bot

Binary Install

To install BCR bot in the binaries:

sudo apt-get install ros-humble-bcr-bot

Run

To launch the robot in Gazebo,

ros2 launch bcr_bot ign.launch.py

To view in rviz,

ros2 launch bcr_bot rviz.launch.py

Configuration

The launch file accepts multiple launch arguments,

ros2 launch bcr_bot ign.launch.py \
	camera_enabled:=True \
	stereo_camera_enabled:=False \
	two_d_lidar_enabled:=True \
	position_x:=0.0 \
	position_y:=0.0  \
	orientation_yaw:=0.0 \
	odometry_source:=world \
	world_file:=small_warehouse.sdf

Note: To use stereo_image_proc with the stereo images excute following command:

ros2 launch stereo_image_proc stereo_image_proc.launch.py left_namespace:=bcr_bot/stereo_camera/left right_namespace:=bcr_bot/stereo_camera/right

Humble + Harmonic (Ubuntu 22.04)

Dependencies

In addition to ROS2 Humble and Gazebo Harmonic installations, we need to manually install interfaces between ROS2 and Gazebo sim as follows,

sudo apt-get install ros-humble-ros-gzharmonic

Remainder of the dependencies can be installed with rosdep

# From the root directory of the workspace. This will install everything mentioned in package.xml
rosdep install --from-paths src --ignore-src -r -y

Build

colcon build --packages-select bcr_bot

Run

To launch the robot in Gazebo,

ros2 launch bcr_bot gz.launch.py

To view in rviz,

ros2 launch bcr_bot rviz.launch.py

Configuration

The launch file accepts multiple launch arguments,

ros2 launch bcr_bot gz.launch.py \
	camera_enabled:=True \
	stereo_camera_enabled:=False \
	two_d_lidar_enabled:=True \
	position_x:=0.0 \
	position_y:=0.0  \
	orientation_yaw:=0.0 \
	odometry_source:=world \
	world_file:=small_warehouse.sdf

Note:

  1. To use stereo_image_proc with the stereo images excute following command:
ros2 launch stereo_image_proc stereo_image_proc.launch.py left_namespace:=bcr_bot/stereo_camera/left right_namespace:=bcr_bot/stereo_camera/right
  1. Harmonic support is not available in the bcr_bot binaries yet.

Warning: gz-harmonic cannot be installed alongside gazebo-classic (eg. gazebo11) since both use the gz command line tool.

Mapping with SLAM Toolbox

SLAM Toolbox is an open-source package designed to map the environment using laser scans and odometry, generating a map for autonomous navigation.

NOTE: The command to run mapping is common between all versions of gazebo.

To start mapping:

ros2 launch bcr_bot mapping.launch.py

Use the teleop twist keyboard to control the robot and map the area:

ros2 run teleop_twist_keyboard teleop_twist_keyboard cmd_vel:=/bcr_bot/cmd_vel

To save the map:

cd src/bcr_bot/config
ros2 run nav2_map_server map_saver_cli -f bcr_map

Using Nav2 with bcr_bot

Nav2 is an open-source navigation package that enables a robot to navigate through an environment easily. It takes laser scan and odometry data, along with the map of the environment, as inputs.

NOTE: The command to run navigation is common between all versions of gazebo.

To run Nav2 on bcr_bot:

ros2 launch bcr_bot nav2.launch.py

Simulation and Visualization

  1. Gz Sim (Ignition Gazebo) (small_warehouse World):

  2. Rviz (Depth camera) (small_warehouse World):

bcr_bot's People

Contributors

angeloantu7 avatar d-1shu avatar exmachina316 avatar ggupta9777 avatar harrisonseby avatar kvkpraneeth avatar leander-dsouza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bcr_bot's Issues

Overwritten parameters and Wrong Terminology

<xacro:property name="traction_wheel_base" value="0.88"/>
is overwritten by
<xacro:property name="traction_wheel_base" value="0.8"/>

This should be fixed by changing the Line 25 parameter name to "traction_track _width" as this number represents the track width or the wheel separation but not wheel base. A diagram for reference:

Similarly, the parameter

<xacro:property name="trolley_wheel_base" value="0.54"/>

Should also be renamed to "trolley_track_width" for correctness.

No Ground Truth data from Gazebo Fortress

No Ground Truth data from Gazebo Fortress

Description

The odometry source in gazebo classic can be switched between world (ground truth) and encoders. Such feature is not available in the diff drive plugin in gazebo fortress. The odometry (including the odom -> base_link transform) is dependent on encoders

Desired outcome

There must be a launch argument for gz.launch.py to switch between ground truth and encoder odometry (both odom->base_link transform and /odom topic)

Namespace Argument in ROS2 + Ignition

Issue with Namespace Argument in ROS2 + Ignition

Description

Currently, the launch file in gz.launch.py does not include a namespace argument. Additionally, in the model spawn, the namespace is not utilized as part of the naming convention for the spawned robot, unlike the ros2 classic and ros1 . Furthermore, the joint states and other topics are hardcoded to "bcr_bot,"

Steps to Reproduce

  1. Execute the current version of gz.launch.py without the namespace argument.
  2. Observe the robot spawn behavior and the naming convention used.
  3. Monitor the topics and verify that they are hardcoded to "bcr_bot".

Expected Behavior

After implementing the proposed changes:

  1. The gz.launch.py launch file should include a namespace argument.
  2. The robot spawned using the model spawn should incorporate the namespace argument in its name.
  3. Joint states and other topics should be properly mapped to the provided namespace.

Addition of base_footprint frame in TF tree

Description

The root frame of the current tf tree for the bot is base_link.

bcr_bot_tf

The following guideline is provided on the nav2 documentation on Setting Up The URDF

The base_footprint link is a virtual (non-physical) link which has no dimensions or collision areas. Its primary purpose is to 
enable various packages determine the center of a robot projected to the ground. For example, Navigation2 uses this link to 
determine the center of a circular footprint used in its obstacle avoidance algorithms. Again, we set this link with no 
dimensions and to which position the robot’s center is in when it is projected to the ground plane.

Maps pass through the bot with nav2 stack

bcr_bot_map_thru_bot

Benifits

Although not a neccesecity, the addition of base_footprint enables the bot to work with nav2 stack out of the box as base_footprint is a default parameter in most cases.

A good example of this would be turtlebot3
turtle_bot_tf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.