Skip to content

kandithws/ros_with_virtual_environment_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ros_with_virtual_environment_example


An example to use python virtualenv (which is recommended to use in many libraries/frameworks installation , i.e. TensorFlow, Flask, etc.. ) with rospy-nodes, which required to use default python interpreter -- specifically for roslaunch.

Prerequisites

  • ROS in your python environment
  • Your virtual environment with the same python version with ROS

Activate your virtual environment (your-venv) and install additional ROS-dependency

$ source your-venv/bin/activate
(your-venv)$ pip install pip --upgrade
(your-venv)$ pip install -U rosdep rosinstall_generator wstool rosinstall
(your-venv)$ pip install --upgrade setuptools

Example

rosrun Example

$ rosrun simple_publisher talker.py --venv /path/to/your-venv

roslaunch Example

$ cp -r your-venv ~/path/to/ros_virtual_env/your-venv/
$ roslaunch simple_publisher example_venv.launch

About

An Example to rosrun/roslaunch python-ROS node with virtual environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors