Skip to content

jmguerreroh/ros2_computer_vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computer Vision using ROS2

This project contains code examples created in Visual Studio Code for Computer Vision using C++ & OpenCV & Point Cloud Library (PCL) using ROS2. These examples are created for the Computer Vision Subject of Robotics Software Engineering Degree at URJC.

This package allows running different Gazebo worlds, including the AWS Robomaker worlds, using the Tiago robot from PAL Robotics

Installation

Source your ROS2 distro:

source /opt/ros/<ros2-distro>/setup.bash

Execute installation script:

./setup.sh

Run Gazebo & Tiago in ROS2

export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
source install/setup.bash
ros2 launch computer_vision simulation.launch.py

To change the Gazebo world or the initial position/rotation of the Tiago robot, you can modify the config/params.yaml file.

If you have a low performance, close the Gazebo's client. Check gzclient process, and kill it:

kill -9 `pgrep -f gzclient`

Run Navigation in ROS2

You can use Nav2 using Tiago in the selected world:

source install/setup.sh
ros2 launch computer_vision tiago_navigation.launch.py

Also, you can use Keepout Zones, just create a new map including the excluded areas, and use the same name adding _keep, now publish the map running:

source install/setup.sh
ros2 launch computer_vision keepzone.launch.py

Just some AWS worlds are included. You can Navigate While Mapping and create your own map using the SLAM Toolbox provided. In different terminals:

  • Run the SLAM Toolbox:
ros2 launch slam_toolbox online_async_launch.py params_file:=install/slam_toolbox/share/slam_toolbox/config/mapper_params_online_async.yaml use_sim_time:=true

In slam_toolbox/config/mapper_params_online_async.yaml change scan_topic from /scan to /scan_raw

  • Activate the map server:
ros2 launch nav2_map_server map_saver_server.launch.py
  • Check the map in RViz:
rviz2 --ros-args -p use_sim_time:=true
  • Save the map:
ros2 run nav2_map_server map_saver_cli --ros-args -p use_sim_time:=true

Run examples in ROS2

  • OpenCV node
source install/setup.sh
ros2 run computer_vision cv_node
  • PCL node
source install/setup.sh
ros2 run computer_vision pcl_node
  • OpenCV & PCL node
source install/setup.sh
ros2 run computer_vision cv_pcl_node

Help

You can check the commands file to run other nodes, such as key_teleop to move Tiago using your keyboard.

About

This is a project made by José Miguel Guerrero, Associate Professor at Universidad Rey Juan Carlos. Copyright © 2022.

Twitter

License

Shield:

CC BY-SA 4.0

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

About

Material URJC Robotics Software Engineering Degree - Computer Vision. This project contains code examples for Computer Vision using C++ & OpenCV & PCL in ROS2

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published