GithubHelp home page GithubHelp logo

iliaselabbassi / ros2_line_follower Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 60 KB

ROS2 application that enable a robot with a camera to follow a line in the floor

CMake 13.51% C++ 83.48% Python 3.02%

ros2_line_follower's Introduction

information

architecture

installation prerequis

  • ROS2 Humble
  • Gazebo
  • ros-humble-gazebo-ros-pkgs
  • Xacro

installation

sudo apt install gazebo sudo apt install ros-humnle-gazebo-ros-pkgs sudo apt install ros-humnle-xacro

TODO

  • find better pid values
  • get contour with the biggest area [ done ]
  • add light automatically in the gazebo environement

misc

create package: ros2 pkg create linefollower

build: cd ros2_ws colcon build

gazebo :

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

Our ros Package :

URDF robot creation :

create a robot model: https://docs.ros.org/en/humble/Tutorials/Intermediate/URDF/Building-a-Visual-Robot-Model-with-URDF-from-Scratch.html

  • clone this repo https://github.com/joshnewans/my_bot this a template for creating urdf xacro robots in ros2
  • create the robot joint and link using xacro to generate the XML URDF file

to build : colcon build --symlink-install

to launch our urdf use : ros2 launch bocchi_bot rsp.launch.py

Run the created robot in Gazebo :

launch urdf in gazeboas it is

  • launch robot_state_publisher in sim mode
  • launch gazebo with ROS compatibility
  • spawn robot in gazebo with spawn script

we need to launch with simulation time so it works well in gazebo

launch robot_state_publisher in sim mode : ros2 launch bocchi_bot rsp.launch.py use_sim_timem:=true

launch gazebo with ROS compatibility : sudo apt install ros--gazebo-ros-pkgs ros2 launch gazebo_ros gazebo.launch.py

spawn robot in gazebo with spawn script : ros2 run gazebo_ros spawn_entity.py -topic robot_description -entity bot_name

create a launch file that will do all the above in one and launch it: colcon build ros2 launch bocchi_bot launch_sim.launch.py

with world as parameter : ros2 launch bocchi_bot launch_sim.launch.py world:=./src/bocchi_bot/worlds/lfm1.world

call service server via cli : ros2 service call /getPidOutput line_follower_interfaces/srv/Angle "{angle: 30, side: 1}"

reset command velocity : ros2 topic pub --once /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"

Trouble shoot

runtime_error
Node '/follow_line' has already been added to an executor.

the basic things that you will need to change are:

https://github.com/ROS-Spanish-Users-Group/ros2_documentation/blob/a3b6c8215c72c95caa2cc44963ff92219376ac27/source/How-To-Guides/Using-callback-groups.rst#L307

ros2_line_follower's People

Contributors

iliaselabbassi avatar

Watchers

 avatar

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.