Gazebo | Ignition | Community
Ask Your Question

Hansg91's profile - activity

2015-12-08 23:59:03 -0500 received badge  Taxonomist
2013-04-08 05:36:24 -0500 commented answer ROS Groovy simulator_gazebo on OSX

Well it is very nice to see that you picked up this task, I don't need gazebo anymore at the moment (intended to use it for navigation, but I am using Stage at the moment) but I have no doubt that for some future feature I will need it and be loving it on OSX :)

2013-04-03 04:58:14 -0500 received badge  Commentator
2013-04-03 04:58:14 -0500 commented answer ROS Groovy simulator_gazebo on OSX

Sounds great :) I don't think you really need XQuartz, you might only need it because somewhere the CMakeLists.txt checks if you have it, its not building against it I believe.

2013-03-25 18:54:13 -0500 received badge  Famous Question (source)
2013-03-20 12:05:51 -0500 commented question ROS Gazebo (OSX) - Waiting for master

Wow sorry I had totally missed that there were comments on this question, my fork is: https://bitbucket.org/hgaiser/gazebo and I am running OSX 10.8.3 (10.8.2 at the moment of writing). I still have this issue but I didn't try much more after this post.

2013-03-20 03:47:01 -0500 commented answer ROS Groovy simulator_gazebo on OSX

Yes that would be a much better solution, but I never worked with Cocoa so I have no idea how to do this, do you? If so, that would be perfect. Do you have the gzserver running by the way? For me it is stuck on Waiting for master, so I run the server on a Parallels Ubuntu and connect to that one ...

2013-03-15 06:47:06 -0500 received badge  Supporter (source)
2013-03-15 06:23:48 -0500 commented answer ROS Groovy simulator_gazebo on OSX

Did you get any further than two windows that cannot be interacted with? ps. I did not need your compile hack commit to compile, why is that?

2013-03-15 03:45:48 -0500 received badge  Famous Question (source)
2013-03-10 04:22:04 -0500 received badge  Notable Question (source)
2013-03-07 11:38:35 -0500 commented answer ROS Groovy simulator_gazebo on OSX

Well it is good to see my sweat and tears were not for nothing :) I'm not sure how much more time I want to spend on gazebo on OSX though, at the moment I am stuck with 2 gazebo windows who cannot seem to receive any mouse/keyboard input. You can't even click on them to get focus (only on their title bars).

2013-03-07 08:48:39 -0500 received badge  Notable Question (source)
2013-03-07 05:10:05 -0500 answered a question ROS Groovy simulator_gazebo on OSX

Here is all the things I needed to do to get it to compile (not work) for OSX :

Do the change as described by tkoolen

Add :

set_property(TARGET ${OGRE_PROJECT_NAME} PROPERTY MACOSX_BUNDLE TRUE)

to the gzaddexecutable macro

Add :

${Boost_LIBRARIES}

to the opende link libraries.

Add :

#if __APPLE__
int isinf( double x ) { return x == x - 1; }
#endif

to gazebo/common/PID.cc

Change the following in gazebo/common/Time.h

 29 #ifdef __MACH__
 30 #include <mach/clock.h>
 31 #include <mach/mach.h>
 32 #include <unistd.h>
 33 #endif

 49 #ifdef __MACH__
 50   clock_resolution.tv_sec = 1 / sysconf(_SC_CLK_TCK);
 51 #else
 52   clock_getres(CLOCK_REALTIME, &clock_resolution);
 53 #endif

 98 #ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
 99   clock_serv_t cclock;
100   mach_timespec_t mts;
101   host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
102   clock_get_time(cclock, &mts);
103   mach_port_deallocate(mach_task_self(), cclock);
104   tv.tv_sec = mts.tv_sec;
105   tv.tv_nsec = mts.tv_nsec;
106 #else
107   clock_gettime(0, &tv);
108 #endif

186 #ifdef __MACH__
187     if (nanosleep(&nsleep, &remainder) == -1)
188 #else
189     if (clock_nanosleep(CLOCK_REALTIME, 0, &nsleep, &remainder) == -1)
190 #endif

216 #ifdef __MACH__
217     if (nanosleep(&nsleep, &remainder) == -1)
218 #else
219     if (clock_nanosleep(CLOCK_REALTIME, 0, &nsleep, &remainder) == -1)
220 #endif

Removed rt from linking library in gazebo/common/CMakeLists.txt

There are some conflicts with generated files and existing files that have the same name but different capitals, which gives conflicts on OSX, therefore you must rename the following files :

gazebo/transport/Transport.hh -> gazebo/transport/Transport.h

Also change in :
gazebo/transport/CMakeLists.txt
gazebo/transport/Transport.cc

gazebo/physics/Physics.hh -> gazebo/physics/Physics.h

Also change in :
gazebo/physics/CMakeLists.txt
gazebo/physics/Physics.cc

gazebo/common/Common.hh -> gazebo/common/Common.h

Also change in :
gazebo/common/CMakeLists.txt
gazebo/common/Common.cc

gazebo/sensors/Sensors.hh -> gazebo/sensors/Sensors.h

Also change in :
gazebo/sensors/CMakeLists.txt
gazebo/sensors/Common.cc

gazebo/rendering/Rendering.hh -> gazebo/rendering/Rendering.h

Also change in :
gazebo/rendering/CMakeLists.txt
gazebo/rendering/Rendering.cc

Add the following include and link directories in the main CMakeLists.txt (perhaps better to place these in the parts that actually need them, got lazy)

 include_directories(/opt/X11/include)
 link_directories(/opt/X11/lib)

Assuming X11 is located there.

Add :

 add_dependencies(gzlog gtest)
 add_dependencies(gzlog gtest_main)

Disable gz_log from tools/test/CMakeLists.txt

Change the following line in gazebui/gui/GLWidget.cc

 718 #if defined(WIN32) || defined(__APPLE__)

Replace google::protobuf::FieldDescriptor::TYPE_BOOL with 1 in gazebo/gui/ModelListWidget.cc

Add GL and GLU to the link target for gzclient

But, now I am stuck on segfaults :)

EDIT: Ok, no segfaults, however I can't seem to process any input :( I get two windows of gazebo but nothing happens if I click on them.

2013-03-06 18:16:18 -0500 received badge  Popular Question (source)
2013-03-06 13:58:15 -0500 received badge  Popular Question (source)
2013-03-04 09:35:23 -0500 received badge  Student (source)
2013-03-03 12:16:14 -0500 commented question ROS Gazebo (OSX) - Waiting for master

Ok the segfault is fixed (changed an if statement so the master is actually created). I am still getting Waiting for master, which I have backtraced to be caused by a Connection refused in boost asio... time to dig further.

2013-03-03 08:47:51 -0500 commented question ROS Gazebo (OSX) - Waiting for master

Also, running gzmaster gives me a segfault at this->connection->Listen(_port, boost::bind(&Master::OnAccept, this, _1));

2013-03-03 08:39:07 -0500 commented question ROS Gazebo (OSX) - Waiting for master

Also, version 1.4 gives standalone gives me the same problems.

2013-03-03 07:13:43 -0500 commented question ROS Gazebo (OSX) - Waiting for master

Also, running just the gzserver gives me the same problems. (I did source the setup.sh)

2013-03-03 07:02:53 -0500 commented question ROS Gazebo (OSX) - Waiting for master

Also, during building of the gazebo package of ROS, I see this error : ERRORFinding dependencies for /Users/hansgaiser/rosws/simulatorgazebo/gazebo/cfg/Physics.cfg

2013-03-02 18:13:13 -0500 asked a question ROS Gazebo (OSX) - Waiting for master

Hello,

I have embarked on the dangerous task to compile gazebo on OSX and after many linking and include changes I finally got it to compile. I am using ROS groovy, which comes with gazebo 1.3.

If I execute the command :

roslaunch gazebo_worlds empty_world.launch

I get the following output :

SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion
 * /use_sim_time

NODES
  /
    gazebo (gazebo/gazebo)
    gazebo_gui (gazebo/gui)

auto-starting new master
process[master]: started with pid [45910]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to d21e6682-8396-11e2-929b-20c9d044a4bb
process[rosout-1]: started with pid [45913]
started core service [/rosout]
process[gazebo-2]: started with pid [45914]
process[gazebo_gui-3]: started with pid [45930]
Gazebo multi-robot simulator, version 1.3.0
Copyright (C) 2012 Nate Koenig, John Hsu, and contributors.
Released under the Apache 2 License.
http://gazebosim.org

Gazebo multi-robot simulator, version 1.3.0
Copyright (C) 2012 Nate Koenig, John Hsu, and contributors.
Released under the Apache 2 License.
http://gazebosim.org

Warning [parser.cc:361] Converting a deprecated SDF source[/Users/hansgaiser/ros_ws/simulator_gazebo/gazebo_worlds/worlds/empty.world].
Set SDF value
  Version[1.2] to Version[1.3]
  Please use the gzsdf tool to update your SDF files.
    $ gzsdf convert [sdf_file]
Msg Waiting for master.[ INFO] [1362269460.264137000]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
Msg Waiting for master....................

And it keeps on waiting forever. I get the same result if I launch emptyworldno_x.launch instead. Running debug.launch gives me :

SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion
 * /use_sim_time

NODES
  /
    gazebo (gazebo/debug)
    gazebo_gui (gazebo/gui)

auto-starting new master
process[master]: started with pid [45813]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to e9d07351-8395-11e2-827f-20c9d044a4bb
process[rosout-1]: started with pid [45816]
started core service [/rosout]
process[gazebo-2]: started with pid [45817]
process[gazebo_gui-3]: started with pid [45841]
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Thu Nov 15 10:42:43 UTC 2012)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ............................
warning: .o file "/usr/local/lib/libboost_system-mt.a(error_code.o)" more recent than executable timestamp in "/usr/local/Cellar/ogre/1.7.4/lib/libOgreMain.1.7.4.dylib"

warning: Could not open OSO file /usr/local/lib/libboost_system-mt.a(error_code.o) to scan for pubtypes for objfile /usr/local/Cellar/ogre/1.7.4/lib/libOgreMain.1.7.4.dylib

warning: .o file "/usr/local/lib/libboost_thread-mt.a(thread.o)" more recent than executable timestamp in "/usr/local/Cellar/ogre/1.7.4/lib/libOgreMain.1.7.4.dylib"

warning: Could not open OSO file /usr/local/lib/libboost_thread-mt.a(thread.o) to scan for pubtypes for objfile /usr/local/Cellar/ogre/1.7.4/lib/libOgreMain.1.7.4.dylib

warning: .o file "/usr/local/lib/libboost_thread-mt.a(once.o)" more recent ...
(more)
2013-03-02 18:08:28 -0500 answered a question ROS Groovy simulator_gazebo on OSX

Ok I appear to have resolved this by using static libraries instead, not sure if that is the most elegant solution, but I finally got it to compile at least...

2013-03-02 08:28:48 -0500 received badge  Editor (source)
2013-03-02 08:26:58 -0500 asked a question ROS Groovy simulator_gazebo on OSX

Hello everyone,

I am trying to install gazebo in the ROS (groovy) stack (simulator_gazebo), which I believe is still 1.3. I am compiling using clang 3.2 (actually it is based on 3.2).

At first it failed to find TBB and libxml2, which I fixed by adding their .pc files so that pkg-config could find them. Then it complained about -DMACOSX_VERSION not being set, so I added

add_definitions(-DMAC_OS_X_VERSIONS=1080)

In the CMakeLists.txt. After that I believe I had some problems with gazebo using CLOCK_REALTIME, which isn't available on OSX so I replaced that with the OSX equivalent.

I have gotten a long way but now I am stuck with linking dependencies for gazebo_sensors and gazebo_physics. gazebo_sensors depends on gazebo_physics, however gazebo_physics seems to also depend on gazebo_sensors, causing a circular dependency. The dependency on gazebo_sensors for gazebo_physics did not exist, without this I was getting linking errors. Adding this link causes a circular dependency. Removing the dependency on gazebo_physics in gazebo_sensors allows it to compile gazebo_physics, but then it gets stuck with linking errors for gazebo_sensors because it is missing things from gazebo_physics there then.

I also tried compiling with gcc (4.2 and 4.7), but this gave me a whole set of different errors.

I had a similar problem with gazebo_physics and gazebo_physics_ode, gazebo_physics_ode needed to link against gazebo_physics, however gazebo_physics did not need to link against gazebo_physics_ode so I could just add the link to gazebo_physics in gazebo_physics_ode.

What can I try next? I can't seem to resolve the circular dependency that I apparently have. How come this compiles fine on Ubuntu (I assume)? Should I actually be asking this on ROS answers? I tried version 1.4 from gazebosim.org but it seems to give me the same problems.