Coder Social home page Coder Social logo

beginner_tutorials's Introduction

beginner_tutorials

Overview

Basic publisher and subcriber implementation in ROS2 Foxy

Requirements

  • Ubuntu 20.04 LTS and ROS2 Foxy
  • rosdep

Building the package

source /opt/ros/foxy/setup.bash

Clone the repository in src of ros workspace


git clone https://github.com/sharmithag/beginner_tutorials.git
cd beginner_tutorials/
mv cpp_pubsub/ ~/<YOUR ROS2 WS FOLDER>/src
mv string_srv/ ~/<YOUR ROS2 WS FOLDER>/src

cd ~/<YOUR ROS2 WS FOLDER>/src

Use colcon to build the package.

cd ..

colcon build --packages-select string_srv
colcon build --packages-select cpp_pubsub

Implementation

default timer rate is 100ms

. install/setup.bash
ros2 launch cpp_pubsub cpp_pubsub.yaml freq:=200

In other terminal(Ctrl+Shift+t) - FOR CHANGING BASE STRING

. install/setup.bash
ros2 service call /service_topic string_srv/srv/Change

In other terminal(Ctrl+Shift+t) - FOR CHECKING tf topic

. install/setup.bash
ros2 run tf2_ros tf2_echo world talk

In other terminal(Ctrl+Shift+t) - FOR CHECKING tf topic frames

. install/setup.bash
ros2 run tf2_tools view_frames.py

In other terminal(Ctrl+Shift+t) - FOR Testing

. install/setup.bash
ros2 run cpp_pubsub test_cpp

# ALTERNATIVE
colcon test --event-handlers console_direct+ --packages-select cpp_pubsub

Launch file for rosbag record

. install/setup.bash
ros2 launch cpp_pubsub cpp_pubsub.py

RQT_CONSOLE

Screenshot from 2022-11-17 18-39-15

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.