No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro jazzy. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.
Repository Summary
Description | Demonstration of ROS2 unit-tests with example of a line follower robot |
Checkout URI | https://github.com/ggupta9777/simple_line_follower.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2023-12-06 |
Dev Status | UNKNOWN |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | testing gtest ros2 colcon |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
simple_line_follower | 0.0.0 |
README
Simple Line Follower
About
This repository demonstrates a basic line-following robot which uses a Proportional-Derivative Controller.
This ROS 2 package is used to demonstrate these examples :
- Code which is tough to test (Ex : naive_line_follower.cpp)
- Code which is easy to test (Ex : line_follower.cpp)
- Basic unit-tests taking the line follower as an example (Ex : test_line_follower_basic.cpp)
- Basic unit-tests taking the naive line follower as an example (Ex : test_naive_line_follower.cpp)
- Good unit tests taking the line follower as an example (Ex : test_line_follower_good.cpp)
Dependencies
- Ubuntu 22.04
- ROS 2 Humble
- Ignition Gazebo(Fortress)
- bcr_bot
Installation
- Clone this repository
git clone git@github.com:ggupta9777/simple_line_follower.git
- Clone bcr_bot
git clone git@github.com:blackcoffeerobotics/bcr_bot.git
- Install dependencies using
rosdep
:
rosdep install --from-paths src -y --ignore-src
- Build the packages with test config(Note : The
--cmake-args
` used above are to enable code coverage analysis)
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage" -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON
Run instructions
- Launch bcr_bot
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:=empty.sdf
-
Run the line follower node
- Run the line_follower_node
ros2 run simple_line_follower line_follower_node --ros-args --params-file src/simple_line_follower/config/params.yaml
- Run the [naive_line_follower_node](src/naive_line_follower.cpp)
ros2 run simple_line_follower naive_line_follower_node --ros-args --params-file src/simple_line_follower/config/params.yaml
Running Tests
- Run the test scripts(Note : The
--event-handler=console_direct+
argument is used to show the logs of the testing process)
colcon test --event-handler=console_direct+
Generate Code Coverage
- Use lcov to generate code coverage
lcov --capture --directory build/ --output-file code_coverage_report.info
- Generate an HTML file to showcase the code coverage report
genhtml code_coverage_report.info --output-directory html_code_coverage_report
- Open the code coverage on your browser
sensible-browser html_code_coverage_report/index.html
Topics
-
/bcr_bot/cmd_vel
: This topic is used to publish velocity messages to the bot in Gazebo -
/bcr_bot/odom
: This topic is used to obtain odometry information regarding the bot
Demo
This is a demo of the bot following a line defined by the waypoints : (0, 1, 0)
and (5, 1, 0)
CONTRIBUTING
No CONTRIBUTING.md found.
No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.