ardupilot_gazebo icon indicating copy to clipboard operation
ardupilot_gazebo copied to clipboard

OSX make error:

Open weixingsun opened this issue 7 years ago • 3 comments

Hi there,

Thanks for making this project, I am trying to compile it on my Mac laptop, and got errors as below, please help if any library I need to add to this project. Mac Pro of Mojave Gazebo 9.5.0 cmake 3.13.0 make 3.81

Thanks a lot

Mac:build sun$ make [ 16%] Building CXX object CMakeFiles/ArduPilotPlugin.dir/src/ArduPilotPlugin.cc.o /Users/sun/Desktop/OpenAI/ardupilot_gazebo-master/src/ArduPilotPlugin.cc:914:39: error: no member named 'GetSimTime' in 'gazebo::physics::World'; did you mean 'SimTime'? this->dataPtr->model->GetWorld()->GetSimTime(); ^~~~~~~~~~ SimTime /usr/local/Cellar/gazebo9/9.5.0/include/gazebo-9/gazebo/physics/World.hh:219:28: note: 'SimTime' declared here public: common::Time SimTime() const; ^ /Users/sun/Desktop/OpenAI/ardupilot_gazebo-master/src/ArduPilotPlugin.cc:999:62: error: no member named 'GetAngle' in 'gazebo::physics::Joint' const double pos = this->dataPtr->controls[i].joint->GetAngle(0).Radian(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ /Users/sun/Desktop/OpenAI/ardupilot_gazebo-master/src/ArduPilotPlugin.cc:1195:53: error: no member named 'GetSimTime' in 'gazebo::physics::World'; did you mean 'SimTime'? pkt.timestamp = this->dataPtr->model->GetWorld()->GetSimTime().Double(); ^~~~~~~~~~ SimTime /usr/local/Cellar/gazebo9/9.5.0/include/gazebo-9/gazebo/physics/World.hh:219:28: note: 'SimTime' declared here public: common::Time SimTime() const; ^ /Users/sun/Desktop/OpenAI/ardupilot_gazebo-master/src/ArduPilotPlugin.cc:1245:27: error: no member named 'GetWorldPose' in 'gazebo::physics::Model' this->dataPtr->model->GetWorldPose().Ign(); ~~~~~~~~~~~~~~~~~~~~ ^ /Users/sun/Desktop/OpenAI/ardupilot_gazebo-master/src/ArduPilotPlugin.cc:1278:38: error: no member named 'GetWorldLinearVel' in 'gazebo::physics::Link' this->dataPtr->model->GetLink()->GetWorldLinearVel().Ign(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ 5 errors generated. make[2]: *** [CMakeFiles/ArduPilotPlugin.dir/src/ArduPilotPlugin.cc.o] Error 1 make[1]: *** [CMakeFiles/ArduPilotPlugin.dir/all] Error 2 make: *** [all] Error 2

weixingsun avatar Nov 25 '18 14:11 weixingsun

hello,

I just have update the repo, try to pull the lastest changes (with git pull). The master branch is now for gazebo9 .

khancyr avatar Nov 25 '18 17:11 khancyr

Hi @khancyr

Thanks for your help on this fix, I appreciate it very much! now I am able to build the project and launch the gzclinet: gazebo --verbose worlds/iris_arducopter_runway.world

But I am wondering where is the ardupilot config for this project, I am pretty new to SITL, thanks :

$ python sim_vehicle.py -v ArduCopter -f gazebo-iris --map --console --no-mavproxy SIM_VEHICLE: Using defaults from (/Users/sun/Desktop/OpenAI/ardupilot/Tools/autotest/default_params/copter.parm,/Users/sun/Desktop/OpenAI/ardupilot/Tools/autotest/default_params/gazebo-iris.parm) SIM_VEHICLE: Run ArduCopter SIM_VEHICLE: "/Users/sun/Desktop/OpenAI/ardupilot/Tools/autotest/run_in_terminal_window.sh" "ArduCopter" "/Users/sun/Desktop/OpenAI/ardupilot/build/sitl/bin/arducopter" "-S" "-I0" "--home" "-35.363261,149.165230,584,353" "--model" "gazebo-iris" "--speedup" "1" "--defaults" "/Users/sun/Desktop/OpenAI/ardupilot/Tools/autotest/default_params/copter.parm,/Users/sun/Desktop/OpenAI/ardupilot/Tools/autotest/default_params/gazebo-iris.parm" SIM_VEHICLE: Waiting for SITL to exit ......

...... another terminal pop up and said: /Users/sun/Desktop/OpenAI/ardupilot/build/sitl/bin/arducopter -S -I0 --home -35.363261,149.165230,584,353 --model gazebo-iris --speedup 1 --defaults /Users/sun/Desktop/OpenAI/ardupilot/Tools/autotest/default_params/copter.parm,/Users/sun/Desktop/OpenAI/ardupilot/Tools/autotest/default_params/gazebo-iris.parm Sun:~ sun$ /Users/sun/Desktop/OpenAI/ardupilot/build/sitl/bin/arducopter -S -I0 --home -35.363261,149.165230,584,353 --model gazebo-iris --speedup 1 --defaults /Users/sun/Desktop/OpenAI/ardupilot/Tools/autotest/default_params/copter.parm,/Users/sun/Desktop/OpenAI/ardupilot/Tools/autotest/default_params/gazebo-iris.parm Unknown parameter SIM_SPEEDUP Mac:~ sun$

weixingsun avatar Nov 26 '18 02:11 weixingsun

As a result of above 2 steps, I can see gzclient opened and a drone is landing there But I don't know how I can write a program/algorithm to take off or hover Please help to give me an idea about where to specify a program to customize the copter behavior

Step 1: (I hope this will create something dynamic in the world below, but it doesn't) python sim_vehicle.py -v ArduCopter -f gazebo-iris --map --console --no-mavproxy

Step 2: (this will create a world with copter statically) gazebo --verbose worlds/iris_arducopter_runway.world

weixingsun avatar Nov 26 '18 15:11 weixingsun