Git Product home page Git Product logo

ros2-cmake-example-project's Introduction

ros2-cmake-example-project

General

This repository contains a small demo of a C++ project within ROS 2 environment using multiple nodes communicating asynchronously with each other using ROS middleware. Plus an extra Python tool package.

There are two C++ nodes: point creator which creates random points, and point enhancer which, well, randomly enhances points. Additionally, there is one Python node that draws a graph of enhanced points online.

Note: usually a name of a directory holding a package should have the same name as the name of the package (i.e., cpp_package_1 should be firstcpp instead), but for clarity reasons (this is an educational repo after all) the name of the directory was different. Exactly the same logic is applied to node names. It is believed that users will understand meaning of certain values better this way.

ROS packages description

cpp_package_1/point_enhancer

  • type: subscriber | type: ChannelFloat32 | name: point | general: listens for float points
  • type: publisher | type: ChannelFloat32 | name: enhanced_point | general: publishes enhanced float points
  • type: publisher | type: UInt32 | name: frame_count | general: publishes the frame counter

cpp_package_2/point_creator

  • type: subscriber | type: UInt32 | name: frame_count | general: listens for the frame counter
  • type: subscriber | type: Bool | name: create | general: listens for a create signal; once a flag with value = 1 is received, float points are created
  • type: publisher | type: ChannelFloat32 | name: point | general: publishes float points

py_package_3/pymodule/plotter_node

  • type: subscriber | type: UInt32 | name: frame_count | general: listens for the frame counter
  • type: subscriber | type: ChannelFloat32 | name: enhanced_point | general: listens for enhanced float points

Requirements

ROS 2 environment installed

cmake version >= 3.16

gcc/g++ version >= 9.0

python 3 version >= 3.8


Please install ROS 2 in advance. You might try installing some of the dependencies running:

bash bin/deps-install.sh

Build

Activate ROS environment; for example:

source /opt/ros/foxy/setup.zsh

Then enter the root directory of the project and do the following:

colcon build --base-paths src && . install/setup.sh

Run

First launch nodes

ros2 launch launch/launch_example.py

Then publish a create signal from the CLI

ros2 topic pub create std_msgs/msg/Bool "data: 1"

ros2-cmake-example-project's People

Contributors

overriden-sfdd 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.