GithubHelp home page GithubHelp logo

pickle-robot / simple Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rospypi/simple

0.0 1.0 0.0 49 MB

License: Apache License 2.0

Dockerfile 2.47% Makefile 3.74% Python 76.36% C 12.97% Shell 1.78% C++ 2.68%

simple's Introduction

THIS IS NOT THE OFFICIAL ROSPY INDEX SERVER

rospy for pure Python

What is this for?

rospy packages without ROS installation. It can be run in a pure python virtualenv. It also supports tf2 and other binary packages.

Supported Python versions: 3.6, 3.7, 3.8

Support platforms: Linux, Windows, MacOSX

(Not all packages are tested.)

Note: If you're using Conda environment, be sure to take a look at RoboStack, which provides more ROS pre-built packages including non-Python packages and tools such as Rviz.

Install

virtualenv -p python3 venv
. ./venv/bin/activate
pip install --extra-index-url https://rospypi.github.io/simple/ rospy
pip install --extra-index-url https://rospypi.github.io/simple/ tf2_ros

Sample

import rospy
import std_msgs.msg


def callback(msg):
    print(msg)


rospy.init_node("hoge")
rospy.loginfo('start')
sub = rospy.Subscriber("sub", std_msgs.msg.String, callback)
pub = rospy.Publisher('pub', std_msgs.msg.Int16, queue_size=10)
rate = rospy.Rate(1)
while not rospy.is_shutdown():
    pub.publish(3)
    rate.sleep()

Enjoy!

Start a local pypi server

docker build -t localpypi .
docker run --rm -p 8000:8000 localpypi
virtualenv -p python3 venv
. ./venv/bin/activate
pip install --extra-index-url http://localhost:8000/index/ rospy

Development

build.py downloads packages from github.com, builds wheel files and generates a Python package server directory.

git submodule update --init --recursive
# create virtualenv for build packages
virtualenv -p python3 dev
. ./dev/bin/activate
pip install --extra-index-url https://rospypi.github.io/simple/ -e rospy-builder/
# build pure python packages
rospy-build build -d any
# build platform depended packages if you need
rospy-build build -d linux --native

To build index html files, use rospypi/index_builder.

pip3 install git+git://github.com/rospypi/index_builder.git
python3 -m index_builder local index/ any/ linux/
python -m http.server
virtualenv -p python3 venv
. ./venv/bin/activate
pip install --extra-index-url http://localhost:8000/index/ rospy

Generate Message Python Package

git clone https://github.com/rospypi/simple.git
cd simple
virtualenv -p python3 venv
. ./venv/bin/activate
pip install --extra-index-url https://rospypi.github.io/simple/ -e rospy-builder/
mkdir msgs
(cd msgs; git clone https://github.com/ros/std_msgs.git)
(cd msgs; git clone https://github.com/ros/common_msgs.git)
# (cd msgs; any repository that is depended on your message)
rospy-build genmsg your_package_path -s msgs/
# ex.rospy-build genmsg ros_tutorials/rospy_tutorials/ -s msgs/

simple's People

Contributors

otamachan avatar bonprosoft avatar supern1ck avatar sergeant-wizard avatar

Watchers

James Cloos 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.