Coder Social home page Coder Social logo

rospy-tup-template's Introduction

A template for building ROS nodes in python with tup on ubuntu

This template implements the basic publish and subscribe rosnodes, using a custom message located in ros/msg/.

Prerequisites:

Install ROS.

To install tup, run scripts/getTup.sh.

Build:

To build, run tup.

The building process generates python code for the messages and services in ros/msg and ros/srv and makes a shell script that makes the python message/service code accessible from your python scripts in the source folders by including its path in PYTHONPATH before calling the sources main.py script. This means you only have to run tup after you have changed the ROS message or service files, or after you have changed the directory structure in src/ by creating, deleting or renaming source directories. You don't need to run tup if you have only made changes to the source code (the python scripts in the folders in src/). This includes file creation/deletion/renaming. Just make sure there is a main.py file in each source directory that calls all your code.

To clean all, run ./scripts/clean.sh. This is mostly needed when debugging the building process.

To see the commands that tup executes, run tup --verbose. This is alse mostly needed when debugging the building process.

Run:

Outputs have the same directory path and name as the source directory, starting from build-native/. (For example the output script from the source directory, src/publisher/ have the path build-native/src/publisher/publisher.)

Run roscore to start the server that the rosnodes uses to communicate with each other.

Modifying template:

Source files are located in separate directories in src/. The only extra-ordinary requirement for source files is that each directory in src/ is supposed to have a main.py file where the main script runs.

Message and service files are located in ros/msg/ and ros/srv/.

The ROS version and package name of the project, as well as the python interpreter are specified in Tuprules.tup.

ROS commands

In order to run ROS commands that needs to know the path to the built ROS messages and services of your project you first need to run source scripts/registerRosMsgSrv.sh. For example the command rostopic echo /pos_publisher will fail before you do this.

rospy-tup-template's People

Contributors

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