simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon simple_line_follower

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 :

Dependencies

  • Ubuntu 22.04
  • ROS 2 Humble
  • Ignition Gazebo(Fortress)
  • bcr_bot

Installation

  1. Clone this repository
    git clone git@github.com:ggupta9777/simple_line_follower.git
    
  1. Clone bcr_bot
    git clone git@github.com:blackcoffeerobotics/bcr_bot.git
    
  1. Install dependencies using rosdep:
    rosdep install --from-paths src -y --ignore-src
    
  1. 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

  1. 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
    
  1. 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

  1. Use lcov to generate code coverage
    lcov --capture --directory build/ --output-file code_coverage_report.info
    
  1. Generate an HTML file to showcase the code coverage report
    genhtml code_coverage_report.info --output-directory html_code_coverage_report
    
  1. 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.

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon

simple_line_follower repository

testing gtest ros2 colcon