Skip to content

bornabesic/simple

 
 

Repository files navigation

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

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
# build index html files
rospy-build index --local any --local linux index
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/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 77.7%
  • C 12.4%
  • Makefile 3.6%
  • C++ 2.6%
  • Dockerfile 2.0%
  • Shell 1.7%