How to properly configure the ROS environment
Hi, thanks for a handy tool for URDF visualization.
When I tried the example, I got the following errors:
[W 2022-08-13 18:46:09.980 ServerApp] 404 GET /ros/pkgs/t12_description/meshes/Body.STL (127.0.0.1) 24.62ms referer=http://localhost:8890/lab
How to properly configure the ROS environment to access mesh '*.stl'?
After I install jupyterlab-ros and jupyterlab-urdf(conda install jupyterlab-urdf -c conda-forge), the path is changed and checked by echo $ROS_PACKAGE_PATH.
Even if I added the current catkin project to this variable, it also cannot access the mesh files.
How could I change the folder/ros/pkgs/ to the one I want to access?
Thanks. Best.
Hello!
I think the problem might be because you need to configure the environment before launching JupyterLab.
Let's say your environment is called ros_env where you already have jupyterlab, jupyterlab-ros, jupyterlab-urdf and ros-noetic-desktop. From a single terminal:
- Activate the environment
conda activate ros_env - Navigate to the
jupyterlab-urdf/examplesfolder. Inside you will find asrcdirectory so essentiallyexamples/is treated as a workspace.
From examples/
- Build the workspace with
catkin build source devel/setup.bash- Your
$ROS_PACKAGE_PATHshould now contain the paths to the robot descriptions - Now you can launch JupyterLab from that same terminal with
jupyter lab
Let me know if this works :)
Hi, @ihuicatl thanks for the quick reply.
My guess is there is a conflict between envs jupyterlab-urdf and catkin source.
When I reinstall jupyterlab-urdf , the path becomes home/*/anaconda3/envs/robostackenv/share/.
When I did catkin build and source devel/setup.bash, then I start jupyter lab the jupyter urdf is not properly started.
It includes the mesh and ros path, but does not includejupyterlab-urdf, e.g. /*/jupyterlab-urdf/examples/src/ned_description:/*/jupyterlab-urdf/examples/src/spot_description:/*/jupyterlab-urdf/examples/src/t12_description:/opt/ros/noetic/share.
Then I manually used export ROS_PACKAGE_PATH to append the necessary path for both jupyter-urdf and catkin. It also did not work. It seems there are some other envs variables needed to be set.
I am looking forward to your reply.
Hi @zengtaiping!
I think the best idea would be to start with a fresh environment. Also, make sure there is nothing in your .bashrc file which could be modifying your ROS paths. Do you have noetic installed locally? It looks like one of your paths includes /opt/ros/noetic/share
- Create environment called
ros_env(or anything else) with the required packages. All of these packages need to be installed in the same environment.conda create -n ros_env jupyterlab jupyterlab-urdf jupyterlab-ros ros-noetic-desktop -c conda-forge -c robostack - Activate the environment
conda activate ros_env - Echo
$ROS_PACKAGE_PATH. This should only containhome/*/anaconda3/envs/ros_env/share/. If this is not correct, there may be an issue with the conda configuration. - Navigate to the examples folder and clean the workspace
cd jupyterlab-urdf/examples/ catkin clean - Build the workspace again with
catkin buildand runsource devel/setup.bashfrom the examples directory - Check your ROS path again, and if everything looks good then you can launch JupyterLab
And just to double check, make sure you are only working with a single conda environment since you mentioned there might be a conflict between environments.
Let me know how it goes.
Hi @ihuicatl ,
I am so sorry for the late response. Thanks so much for your detailed information. It works now.
I am sorry for the wrong click. Please close this issue.