Basics
Make sure your svn tree is up-to-date and preferably free of conflicts from the repository.
- If you get error loading shared libraries at runtime, e.g.
gazebo: error while loading shared libraries: libfreeimage.so.3: cannot open shared object file: No such file or directory
Simulator Behaves Strangely
Problem: Robot not spawning correctly with urdf2gazebo, urdf2gazebo does not wait for gazebo to be initialized before trying to connect to FactoryIface.
Solution: remove temporary directories, usually in /tmp/gazebo-[username]-0
- If you are using a customized world/robot, you can check a few things from the physics end.
- If the system is unstable, what is the world time step size? Try decreasing it by an order of magnitude.
- Check your mass properties.
- Make sure the mass matrices are reasonable. Applying a force/torque to a body with very small mass/MOI will lead to NaN states very quickly.
- Very large mass ratios between connected bodies will require more labor from the physics constraint solver (smaller time steps or more iterations per timestep). In general, ODE's quick step implementation seems more predictable and stable than the default Lemke's solver.
- Robot not casting shadows correctly
- rebuild meshes by
roscd gazebo_worlds rm -rf Media/models/pr2 rosmake
- rebuild meshes by
Simulator Fails to Compile
- Gazebo complains of missing dependencies
bash <(rosdep satisfy gazebo)
- make clean in gazebo than re-make
Cleaning and Recompiling
Being an actively developed package, sometimes stale dynamic libraries persist. The easiest way to get rid of them is to rosmake clean the gazebo dependencies or remove them entirely and get a new copy from svn trunk. Unfortunately, rosmake does not support clean yet, so if you don't want to check out a new tree and build from scratch, you can browse gazebo dependencies by using the rospack command:
$rospack deps gazebo opende ogre genmsg_cpp roslib std_msgs image_msgs opencv_latest
Below are some suggested cleaning methods:Manual: roscd into each package listed above and issue the make clean command.
- Untested:
rospmake --target=clean gazebo
Untested option2 (only do this if you know what this bit of code does):
rospack deps gazebo | awk '/.*/ {print "(roscd "$_"; make clean;)"}' | /bin/tcsh
Often times binaries change location within a package or refuse to be cleaned by make clean. You will need to remove each package manually and re-svn up from trunk.
Untested option for removing packages (only do this if you know what this bit of code does):
rospack deps gazebo | awk '/.*/ {print "rospack find "$_}' | /bin/tcsh | awk '/.*/ {print "mv "$_" /tmp/"}' | /bin/tcsh
- When everything is clean,
cd $ROS_PACKAGE_PATH svn up rosmake gazebo