Coder Social home page Coder Social logo

nickknack15 / python-actionlib-demo Goto Github PK

View Code? Open in Web Editor NEW
11.0 0.0 5.0 9 KB

A simple demo for showing how to interact with action lib in Python 2.7

CMake 39.12% Python 60.88%
ros ros-kinetic actionlib publisher-subscriber python27 ros-packages

python-actionlib-demo's Introduction

Python Actionlib Demo

Description

This is a simple demo for showing how to interact with action lib in Python 2.7. Actionlib is a powerfull asynchronous library built in ROS that will allow you to do multithreaded things without dealing with the threading overhead of Python 2.7. This demo will allow you to interact with two different actions independently of each other. You can start them with publishing to a topic, and cancel them by publishing to a different topic. See usage details below.

Running the Nodes

Option 1: Start all nodes with roslaunch.

$ roslaunch actionlib_demo dummy.launch --screen

*The --screen flag logs output from all nodes to the terminal.

Option 2: Start nodes individually.

# Terminal 1 - The 'actionlib_demo_client' node.

$ rosrun actionlib_demo start_dummy_action_client.py
# Terminal 2 - The 'actionlib_demo_server' node.

$ rosrun actionlib_demo start_dummy_action_server.py

Triggering an Action

publish a message to topic "trigger_one" from a teminal to start action 1

$ rostopic pub /trigger_one std_msgs/String "data: ''"

publish a message to topic "trigger_two" from a terminal to start action 2

$ rostopic pub /trigger_two std_msgs/String "data: ''"

Cancelling an Action In Progress

publish a mesage to topic "other_topic_one" from a terminal to cancel action 1

$ rostopic pub /other_topic_one std_msgs/String "data: ''"

publish a message to topic "other_topic_two" from a terminal to cancel action 2

$ rostopic pub /other_topic_two std_msgs/String "data: ''"

python-actionlib-demo's People

Contributors

nickknack15 avatar

Stargazers

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