Skip to content

Instantly share code, notes, and snippets.

@anindex
Created August 12, 2022 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anindex/dd4e9531dbe388bae381b1a8905f0a84 to your computer and use it in GitHub Desktop.
Save anindex/dd4e9531dbe388bae381b1a8905f0a84 to your computer and use it in GitHub Desktop.

ROS + Conda (mambaforge) for all-in-one environment

Motivations

Some autodiff libraries such as torch or tensorflow are preferably worked on a conda environments. Moreover, most of modern Python libraries needs to be installed on Python 3. This instruction will introduce how to install every needed libraries of ROS and project specific Python libraries in the same environment, for real world robot experiments. Currently, Panda Arm is well supported in RobotStack. Hopefully in the future they support other robot platforms like Tiago as well.

Tested specs: Ubuntu 20.04 + ROS Noetic + Panda Franka

Installation (with conda!)

First, please download and install mambaforge, then follow these steps:

mamba create -n ros_env python=3.9
conda activate ros_env
conda config --env --add channels conda-forge
# and the robostack channels
conda config --env --add channels robostack
conda config --env --add channels robostack-experimental

mamba install ros-noetic-desktop-full
mamba install compilers cmake pkg-config make ninja colcon-common-extensions
mamba install catkin_tools

# must do this
conda deactivate
conda activate ros_env

Now install rosdep and initialize:

rosdep init  # note: do not use sudo!
rosdep update

For installing Franka libraries, we can install libfranka and franka_ros by:

mamba install ros-noetic-libfranka
mamba install ros-noetic-franka-ros

Now you can install whatever Python 3 libraries needed for your project here (including torch or tensorflow).

pip install <your libraries>

After that, you can create a catkin workspace (while still activating the ros_env):

mkdir -p ~/catkin_ws/src && cd ~/catkin_ws
# now clone your project repos into src (e.g. using vcstool)
...

# finally compile your catkin ws
catkin build -DCMAKE_BUILD_TYPE=Release

Usage

For using your conda env + ROS Noetic, whenever openning a new terminal, do:

conda activate ros_env
source ~/catkin_ws/devel/setup.bash

Example

For running a check for Panda movements, make sure first to follow Panda startup instructions. Then try:

roslaunch franka_example_controllers joint_impedance_example_controller.launch
robot_ip:=<panda_ip> load_gripper:=true

References

List of all ROS packages of RoboStack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment