0
$\begingroup$

Rosanswers logo

I am working on a mobile robot that can detect and track people. for the detection and tracking, i want to use my own models and write a ros node that will publish the coordinates of the person you want to follow to the action server. i have ros kinetic installed,and i installed anaconda and made a conda env with all the deep learning libraries i need.however i am wondering how can i work with ros inside my conda env in which python 3 is the default language. ps:i have seen that you can modify your bash rc to work with either of them,but you cant work with both at the same time (with ros while inside my conda env) ps: the solution at https://github.com/udacity/RoboND-Python-StarterKit/blob/master/doc/linux_ros_anaconda_warning.md made me unable to work with ros at all.and conda still worked even when i didnt do the unset pythonpath. ps: i cant install kinetic for python 3 because i need to use other packages in the navigation stack.


Originally posted by mohamedaminhuidi on ROS Answers with karma: 21 on 2019-02-09

Post score: 1

$\endgroup$

3 Answers 3

2
$\begingroup$

Rosanswers logo

Hi! I found this answer from a Google search, just for your information in 2021 installing ROS directly in conda (without using apt-installed ROS at all, so removing any risk of incompatibility) should be much straightforward.

In particular you can simply install ROS Noetic packages in a conda environment with the following command:

conda install -c conda-forge -c robostack-staging ros-noetic-desktop

See the following links for more details:


Originally posted by Silvio Traversaro with karma: 56 on 2021-02-18

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by jayess on 2021-02-18:
Instead of posting a link to a blog post could you please update your answer with a summary of it or the relevant information from it?

Comment by Silvio Traversaro on 2021-02-19:
Done, feel free if you think the answer can be further improved.

$\endgroup$
0
$\begingroup$

Rosanswers logo

got my answer.you can't use conda and ros together. i think there is a way that can get you to use ros in a conda environment,but then you won't be able to use it outside of that env. basically its not worth the effort. just install whatever deep learrning library you want without conda, and specifiy in the shebang of your ros node what version of python you are using(python or python3).


Originally posted by mohamedaminhuidi with karma: 21 on 2019-02-25

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by rickstaa on 2019-11-08:
I created a small wrapper that might ease the process of using ROS inside a Conda environment. It can be found here.

Comment by mohamedaminhuidi on 2019-11-08:
well that's awesome, its an amazing application. thank you sir.

$\endgroup$
0
$\begingroup$

One way I was using ROS with conda environment is changing shebang at the start of the py script to the path of the python installed by the conda.

It is quite convenient way to do it if you want to use conda for managing python packages and be able to access all other ROS packages.

So basically I first activate new conda environment with python version I want(I have preinstalled ROS on my Linux). After that I install rospy and rospkg pip packages, and change shebangs and it works like charm!

I'm using that configuration when I want to implement some deep learning architecture into my ROS node. You can see example here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.