Rapid prototyping with rosh



Similar documents
Introduction to Python

Microsoft Windows PowerShell v2 For Administrators

AdRadionet to IBM Bluemix Connectivity Quickstart User Guide

Mojolicious. Marcos Rebelo

Why are we teaching you VisIt?

Amira License Manager

Desktop, Web and Mobile Testing Tutorials

FEI Avizo License Management

How to extend Puppet using Ruby

Beginning to Program Python

AWS Device Farm. Developer Guide API Version

A Gentle Introduction to ROS

Hadoop Streaming. Table of contents

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

Tutorial 2 Online and offline Ship Visualization tool Table of Contents

EVENT LOG MANAGEMENT...

Lab 3: Introduction to Data Acquisition Cards

Understanding Task Scheduler FIGURE Task Scheduler. The error reporting screen.

Understanding and using catkin (and bloom) May 12, 2013 Dirk Thomas, William Woodall ROSCon 2013

Appendix K Introduction to Microsoft Visual C++ 6.0

CloudCTI Recognition Configuration Tool Manual


Generating Automated Test Scripts for AltioLive using QF Test

Windows PowerShell Cookbook

Survey of Unit-Testing Frameworks. by John Szakmeister and Tim Woods

Kepware Technologies KEPServerEX Client Connectivity Guide for GE's Proficy ifix

10 Java API, Exceptions, and Collections

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

Project Builder for Java. (Legacy)

latest Release 0.2.6

Triple-E class Continuous Delivery

UNIX, Shell Scripting and Perl Introduction

Cyber Security Challenge Australia 2014

Objectives. Python Programming: An Introduction to Computer Science. Lab 01. What we ll learn in this class

ReSTful OSGi Web Applications Tutorial. Khawaja Shams & Jeff Norris

Azure Day Application Development

1. Stem. Configuration and Use of Stem

A Crash Course on UNIX

Mercury User Guide v1.1

Building a Python Plugin

Adobe Summit 2015 Lab 718: Managing Mobile Apps: A PhoneGap Enterprise Introduction for Marketers

Nexio Connectus Cluster Set Up with SQL Server Backend

NASA Workflow Tool. User Guide. September 29, 2010

Step-By-Step Guide to Deploying Lync Server 2010 Enterprise Edition

Facebook Twitter YouTube Google Plus Website

Hadoop Scripting with Jaql & Pig

Kaspersky Password Manager

Getting Started using the SQuirreL SQL Client

LOYEX TRADING STATION

Use of ROOT in Geant4

WRITING HONEYPOINT PLUGINS WITH HONEYPOINT SECURITY SERVER

Illustration 1: Diagram of program function and data flow

SMock A Test Platform for the Evaluation of Monitoring Tools

Silect Software s MP Author

Backup Server DOC-OEMSPP-S/6-BUS-EN

CS 1133, LAB 2: FUNCTIONS AND TESTING

Apache Thrift and Ruby

PROGRAMMING FOR BIOLOGISTS. BIOL 6297 Monday, Wednesday 10 am -12 pm

CafePilot has 3 components: the Client, Server and Service Request Monitor (or SRM for short).

Cloud Computing. Chapter Hadoop

SourceAnywhere Service Configurator can be launched from Start -> All Programs -> Dynamsoft SourceAnywhere Server.

Introduction. Chapter 1

Profiling, debugging and testing with Python. Jonathan Bollback, Georg Rieckh and Jose Guzman

Installing Your Software

Continuous Integration In challenging environments w/ Ansible. PyCon5 Italy, Cesare Placanica

A Tour of Silex and Symfony Components. Robert

Zipit Chat. Functional Specification / User Manual

Slides from INF3331 lectures - web programming in Python

A visual DSL toolkit in Lua

LifeCyclePlus Version 1

TIPS & TRICKS JOHN STEVENSON

IBM Endpoint Manager Version 9.1. Patch Management for Red Hat Enterprise Linux User's Guide

Instructions for Accessing the Hodges University Virtual Lab

Snare System Version Release Notes

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

A QUICK OVERVIEW OF THE OMNeT++ IDE

Lab - Building an Internet of Things Application Hands-On Lab

InfoSphere Master Data Management operational server v11.x OSGi best practices and troubleshooting guide

Test Automation Integration with Test Management QAComplete

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

CONFIGURING ECLIPSE FOR AWS EMR DEVELOPMENT

IBM Endpoint Manager Version 9.2. Patch Management for SUSE Linux Enterprise User's Guide

Leveraging Cloud Storage Through Mobile Applications Using Mezeo Cloud Storage Platform REST API. John Eastman Mezeo

EMC Documentum Content Services for SAP iviews for Related Content

L04 C Shell Scripting - Part 2

Using EDA Databases: Milkyway & OpenAccess

VisIt Visualization Tool

Snapt Redundancy Manual

WORKFLOW Parent/Child Forms. Adrian Jimenez Winshuttle

Guile Present. version 0.3.0, updated 21 September Andy Wingo

Visualisation in the Google Cloud

Quote to Cloud Connecting QuoteWerks and Xero

Visual C Tutorial

Advanced Bash Scripting. Joshua Malone

7.1 Transfers Cancellations & Refunds Net Rate Module for Agent Processing...

Smartphone market share

WORKING WITH LOAD BALANCING AND QUEUEING FOR ADOBE INDESIGN CS5 SERVER

Transcription:

Rapid prototyping with rosh Dan Lazewatsky (dlaz) Personal Robotics Lab School of Mechanical, Industrial and Manufacturing Engineering Oregon State University

rosh history Originally written by Ken Conley in 2011 Demoed at Google I/O Mostly forgotten since then

What is rosh? ros h? ro sh? rosh...ambo? python scripting environment for ROS interactive shell scripts

What does rosh do? Eliminates boilerplate code Eases introspection topics, services, nodes, actions, transforms, Enables interaction with entire installed ROS ecosystem packages, messages, bags,

What is rosh good for interactive debugging short, linear scripts glue not good for long scripts high performance multi-threaded code

rosh basics Looping forever: while ok(): Getting info: info(<almost anything>) Visualization: show(<almost anything>) Useful aliases: rosh rospy now() Time, Duration, Sleep Header rospy.time.now() rospy.<time, Duration, Sleep> rospy.header

Ways to use rosh interactive shell tab completion of topics, services, message names, lots more script rosh is on your path! #!/usr/bin/env rosh

rosh basics: packages Accessing package info packages.<pkg_name> Available information name: package name path: full path to package depends1: direct package dependencies (build_depend+run_depend) launches: launch files in package manifest: manifest.xml or package.xml msg: messages defined in package srv: services defined in package nodes: nodes defined in package Example In [1]: packages.tf.depends1.angles.path Out[1]: u'/opt/ros/hydro/share/angles'

rosh basics: messages Accessing message info msg.<pkg_name> Equivalent to packages.<pkg_name>.msg Instantiating messages msg.std_msgs.colorrgba() With positional arguments msg.std_msgs.colorrgba(195,69,0,0) With keyword arguments msg.std_msgs.colorrgba(r=195,g=69) Getting Message Definition [1]: show msg.std_msgs.colorrgba -------> show(msg.std_msgs.colorrgba) float32 r float32 g float32 b float32 a

rosh basics: topics (basics) Subscribing Get the last message: topics.topic_name[0] Get the next message: topics.topic_name[1] Get all future messages: for msg in topics.topic_name[:]: Publishing Publish a message object: topics.topic_name(msg) Publish and create a new object (e.g. ColorRGBA): topics.topic_name(r=195, g=69, b=0)

rosh basics: topics (advanced) Get all future messages: for msg in topics.topic_name[:]: Get M through Nth messages on topic: for msg in topics.topic_name[m:n]: Pipe one topic to another (topic_tools/mux) topics.topic_name = topics.other_topic_name Publish on a new topic rostype(topics.new_topic, msg.std_msgs.colorrgba)

rosh basics: topic introspection Get message definition for topic Get nodes publishing topic Get nodes subscribing to topic topics.color Out[0]: float32 r float32 g float32 b float32 a

rosh basics: topic introspection Get message definition for topic Get nodes publishing topic Get nodes subscribing to topic ni = info(topics.color) ni.pub_nodes() Out[1]: /color_pub_node

rosh basics: topic introspection Get message definition for topic Get nodes publishing topic Get nodes subscribing to topic ni = info(topics.color) ni.sub_nodes() Out[2]: /rostopic_13197_1408484321 530

rosh basics: services Calling services Call a service with a request object resp = services.a_srv(req) Call a service while creating a new request resp = services.rosout.set_logger_level('ros', 'warn')

rosh basics: topics + services example Turn a service into a topic rosh rostype(topics.set_camera_info, msg.sensor_msgs.camerainfo) for info_msg in topics.set_camera_info[:]: services.camera_driver.set_camera_info(info_msg) rospy import rospy from sensor_msgs.msg import CameraInfo from sensor_msgs.srv import SetCameraInfo def info_cb(msg, info_proxy): info_proxy[0](msg) rospy.init_node('topicify_camera_info') info_proxy = rospy.serviceproxy('set_camera_info', SetCameraInfo) rospy.subscriber('set_camera_info', CameraInfo, info_cb, callback_args=(info_proxy,))

rosh basics: parameters Retrieve a parameter param_value = parameters.foo() Set a parameter parameters.foo = bar Set a bunch of parameters in a namespace parameters.foo = dict(bar= baz, qux= asdf ) $ rosparam list /foo /foo/bar /foo/qux Load parameters from yaml file params = rosparam( params.yaml ) Set parameters from yaml file parameters.foo = params[ foo ] # params.yaml foo: bar: baz qux: asdf

rosh plugins Plugins provide additional functionality Available plugins: plugin rosh_common rosh_geometry rosh_visualization rosh_robot rosh_desktop Loading plugins In code provides actions, cameras transforms, geometry helpers show(cameras.<camera>) meta-plugin (loads rosh_common, rosh_geometry) meta-plugin (loads rosh_visualization, rosh_common, rosh_geometry) load( foo_plugin, globals()) From the command line $ rosh --plugins=foo_plugin,bar_plugin At startup #~/.ros/rosh/roshrc.py plugins[ foo_plugin, bar_plugin ]

rosh basics: geometry Lookup transform xform = transforms.<src_frame>( <target_frame> ) Also provides Point Quaternion PointStamped PoseStamped QuaternionStamped Vector3Stamped

more features Topic tools mux, relay, throttle Bags with Bag('test.bag') as bag: for topic, msg, t in bag.read_messages(topics=['foo']): print msg Bagys (like bags, stored as yaml)

Putting it all together Two robots enter, one leaves random_move.py: moves one robot about randomly follow.py: tries to crash another robot into first robot reset.py: teleports robots to random locations on crash Code available at https://github.com/dlaz/rosh_turtlebot_demo

http://wiki.ros.org/rosh https://github.com/osurobotics/rosh_robot_core https://github.com/osurobotics/rosh_robot_plugins https://github.com/osurobotics/rosh_desktop_plugins