GithubHelp home page GithubHelp logo

ros2_examples's Introduction

ROS Packages for reference (ros2_examples)

Build Status

Travis CI (master) Travis CI (develop)
Build Status Build Status

examples_msgs

Message file

  • Count.msg

Service file

  • Calculation.srv

Action file

  • Led.action

examples_rclcpp

Publisher

$ ros2 run examples_rclcpp publisher -c ${comment} -q ${qos_profile}

Subscriber

$ ros2 run examples_rclcpp subscriber -q ${qos_profile}

Server

$ ros2 run examples_rclcpp server
$ ros2 service call /calculate examples_msgs/Calculation "{a: 1, b: 2, arithmetic_operator: "plus"}"

${arithmetic_operator} : plus, minus, multiply, division

Client

$ ros2 run examples_rclcpp client -a ${number} -b ${number} -o ${arithmetic_operator}

${arithmetic_operator} : plus, minus, multiply, division

Action Server

$ ros2 run examples_rclcpp action_server

Action Client

$ ros2 run examples_rclcpp action_client -n ${number}

Launch

$ ros2 launch examples_rclcpp pub.launch.py
$ ros2 launch examples_rclcpp sub.launch.py
$ ros2 launch examples_rclcpp multiple_node.launch.py
$ ros2 launch examples_rclcpp multiple_launch.launch.py

examples_rclpy

Publisher

$ ros2 run examples_rclpy publisher -q ${qos_profile}

Subscriber

$ ros2 run examples_rclpy subscriber -q ${qos_profile}

Server

$ ros2 run examples_rclpy server
$ ros2 service call /calculate examples_msgs/Calculation "{a: 1, b: 2, arithmetic_operator: "plus"}"

Client

$ ros2 run examples_rclpy client -a ${number} -b ${number} -o ${arithmetic_operator}

${arithmetic_operator} : plus, minus, multiply, division

Launch

$ ros2 launch examples_rclpy pub.launch.py
$ ros2 launch examples_rclpy sub.launch.py
$ ros2 launch examples_rclpy multiple_node.launch.py
$ ros2 launch examples_rclpy multiple_launch.launch.py

examples_rqt

Install dependency software for development

  • Qt Creator 4.5.x Based on Qt 5.9.x (GCC 7.3.x, 64 bit)
$ sudo apt install qtcreator

Install dependency package for test

  • teleop_twist_keyboard package
$ cd PATH/THE/YOUR/ROS2_WORKSPACE/src
$ git clone https://github.com/ros2/teleop_twist_keyboard.git
$ cd ..
$ colcon build --symlink-install --packages-select teleop_twist_keyboard

Run Method 1: run examples_rqt

$ ros2 run examples_rqt examples_rqt

Run Method 2: run rqt and add a examples_rqt as plugin

  • Menu > Plugins > Visualization > Viewer
$ rqt

Test: run examples_rqt, teleop_keyboard node, call service

$ ros2 run examples_rqt examples_rqt
$ ros2 run teleop_twist_keyboard teleop_twist_keyboard
$ ros2 topic echo /cmd_vel
$ ros2 service call /led_control std_srvs/srv/SetBool '{data: True}'
$ ros2 service call /led_control std_srvs/srv/SetBool '{data:False}'

examples_tf

Run examples_tf

$ ros2 run examples_tf2 broadcaster
$ ros2 run examples_tf2 listener
$ ros2 run examples_tf2 static_broadcaster
$ ros2 run rviz2 rviz2 -d examples_tf2/rviz/arm.rviz
$ ros2 service call state std_srvs/srv/SetBool "data: false"

examples_lifecycle

Run examples_lifecycle

$ ros2 run examples_lifecycle robot

Launch examples_lifecycle

$ ros2 launch examples_lifecycle bringup.launch.py auto_activate:=False

Lifecycle client

Trigger lifecycle state transition

$ ros2 lifecycle set /example/robot configure
$ ros2 lifecycle set /example/robot activate
$ ros2 lifecycle set /example/robot deactivate
$ ros2 lifecycle set /example/robot shutdown

Get lifecycle state for one or more nodes

$ ros2 lifecycle get /example/robot

Output a list of available transitions

$ ros2 lifecycle list /example/robot

Output a list of nodes with lifecycle

$ ros2 lifecycle nodes

ros2_examples's People

Contributors

ohsunghyeon avatar robotpilot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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