Gazebo ROS package deb version problem
Hey guys,
I have run into a problem I was hoping someone could help me with. I have currently installed the latest gazebo ros packages (Debian version) and the only way I am able to get gazebo up and running is by sourcing the setup.bash file located in
/opt/ros/hydro/setup.bash
However my robot configurations and ros nodes are created and kept in the catkin workspace. When I want to run a ros node that communicates with gazebo I need to source the setup.bash in my catkin workspace which is in my home directory. (~/catkin_ws/..)
source devel/setup.bash
When I source the above command and try to roslaunch a node that lets me spawn a robot model into gazebo I keep getting an error saying that both Gzserver and Gzclient did not launch. The reason is because I did not "source /opt/ros/hydro/setup.bash".
core service [/rosout] found
ERROR: cannot launch node of type [gazeboros/gzserver]: can't locate node [gzserver] in package [gazeboros] ERROR: cannot launch node of type [gazeboros/gzclient]: can't locate node [gzclient] in package [gazeboros]
Any ways so my question is do I need to install the gazebo ros packages from source and into the catkin workspace? Or is there an alternative that allows me to use the deb packages.
Thanks Mike
Asked by mfran89 on 2014-02-07 10:02:41 UTC
Answers
I got same error because I sourced the workspace before I run catkin_make. I used ROS Hydro and Gazebo 1.9.
Solution ; Backup the src folder of workspace, delete the workspace folder and create it again.
source /opt/ros/hydro/setup.bash
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws
catkin_make
and copy src folder to ~/catkin_ws/src. Do not forget source your workspace in /.bashrc with
source ~/catkin_ws/devel/setup.bash
Asked by jalfonso on 2014-04-30 16:53:01 UTC
Comments
this is a very strange behaviour in general your catkin workspace should source the /opt/ros/hydro/setup.bash automaticaly
Asked by evilBiber on 2014-02-07 10:46:05 UTC
I do source that in the .bashrc so when I am in the catkin_workspace that is automatically sourced. However I cannot source devel/setup.bash then. Its as if I can only have one or the other not both sourced at the same time. Btw my knowledge on ubuntu concepts is still weak because I am new to the Linux world, so if there is way for both to be sourced at the same time that would be great.
Asked by mfran89 on 2014-02-07 11:16:48 UTC
i only source the setup.bash of my workspace! this setup bash should source the hydro/setup.bash automatically! have you created the workspace with groovy or was hydros setup.bash sourced when you created the workspace?
Asked by evilBiber on 2014-02-07 11:59:36 UTC
I did not install workspace with groovy, I installed with hydro. When I refer to devel.setup.bash I am referring to the setup.bash file of my workspace. However I dont think it sources hydro/setup.bash file in it. Setup.bash file in my workspace down below
Asked by mfran89 on 2014-02-07 12:11:44 UTC
!/usr/bin/env bash generated from catkin/cmake/templates/setup.bash.in CATKIN_SHELL=bash
source setup.sh from same directory as this file _CATKIN_SETUP_DIR=$(builtin cd "
dirname "${BASH_SOURCE[0]}"
" && pwd) . "$_CATKIN_SETUP_DIR/setup.sh"Asked by mfran89 on 2014-02-07 12:15:57 UTC
So an example to illistrate my problem would be if I source my bash file in the ws, and use the command "rosrun gazebo_ros gazebo". I get this message "[rosrun] Couldn't find executable named gazebo below /opt/ros/hydro/share/gazebo_ros" When I manually source the hydro bash file and run the same command Gazebo runs fine and works.
Asked by mfran89 on 2014-02-07 13:05:34 UTC
Can you post the contents of the
ROS_PACKAGE_PATH
environment variable in both situations?Asked by nkoenig on 2014-02-21 14:07:42 UTC
I got same error because I sourced the workspace before I run catkin_make. Solution ; delete the workspace folder and create again.
Asked by jalfonso on 2014-04-30 16:28:20 UTC