# Install freebuoyancy\_gazebo plugin problem

**URL:** <https://discuss.bluerobotics.com/t/install-freebuoyancy-gazebo-plugin-problem/9620>\
**Category:** BlueROV2\
**Tags:** sitl, simulate\
**Created:** [May 6, 2021, 6:18pm UTC](https://discuss.bluerobotics.com/t/install-freebuoyancy-gazebo-plugin-problem/9620 "2021-05-06T18:18:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammad](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@mohammad](https://discuss.bluerobotics.com/u/mohammad)\
**Post date:** [May 6, 2021, 6:18pm UTC](https://discuss.bluerobotics.com/t/install-freebuoyancy-gazebo-plugin-problem/9620/1 "2021-05-06T18:18:40Z")

</div>

Hi  
i have installed gazebo 7 and i cloned ardupilot code in ubuntu 16.04 64 bit.  
i receive this error when installing freebuoyancy\_gazebo plugin.

```
farhad@farhad:~/freebuoyancy_gazebo/build$ make
Scanning dependencies of target freebuoyancy_gazebo
[50%] Building CXX object CMakeFiles/freebuoyancy_gazebo.dir/src/freebuoyancy.cpp.o
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp: In member function ‘virtual void gazebo::FreeBuoyancyPlugin::OnUpdate()’:
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:74:25: error: ‘class gazebo::physics::World’ has no member named ‘ModelCount’
     for (i=0; i<world_->ModelCount(); ++i) {
                         ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:77:25: error: ‘class gazebo::physics::World’ has no member named ‘ModelByIndex’
             if (world_->ModelByIndex(i)->GetName() == model_it->name)
                         ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:80:33: error: ‘class gazebo::physics::World’ has no member named ‘ModelByIndex’
         if (!found && !(world_->ModelByIndex(i)->IsStatic())) // model not in listand not static, parse it for potential buoyancy flags
                                 ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:81:35: error: ‘class gazebo::physics::World’ has no member named ‘ModelByIndex’
             ParseNewModel(world_->ModelByIndex(i));
                                   ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:88:29: error: ‘class gazebo::physics::World’ has no member named ‘ModelCount’
         for (i=0; i<world_->ModelCount(); ++i) {
                             ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:89:25: error: ‘class gazebo::physics::World’ has no member named ‘ModelByIndex’
             if (world_->ModelByIndex(i)->GetName() == model_it->name)
                         ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:103:39: error: ‘class gazebo::physics::Link’ has no member named ‘WorldPose’
         cob_position = link_it->link->WorldPose().Pos() + link_it->link->WorldPose().Rot().RotateVector(link_it->buoyancy_center);
                                       ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:103:74: error: ‘class gazebo::physics::Link’ has no member named ‘WorldPose’
         cob_position = link_it->link->WorldPose().Pos() + link_it->link->WorldPose().Rot().RotateVector(link_it->buoyancy_center);
                                                                          ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:124:46: error: ‘class gazebo::physics::Link’ has no member named ‘WorldPose’
         velocity_difference = link_it->link->WorldPose().Rot().RotateVectorReverse(link_it->link->WorldLinearVel() - fluid_velocity_);
                                              ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:124:99: error: ‘class gazebo::physics::Link’ has no member named ‘WorldLinearVel’
         velocity_difference = link_it->link->WorldPose().Rot().RotateVectorReverse(link_it->link->WorldLinearVel() - fluid_velocity_);
                                                                                                   ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:130:40: error: ‘class gazebo::physics::Link’ has no member named ‘WorldPose’
         actual_force -= link_it->link->WorldPose().Rot().RotateVector(link_it->linear_damping * velocity_difference);
                                        ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:135:46: error: ‘class gazebo::physics::Link’ has no member named ‘RelativeAngularVel’
         velocity_difference = link_it->link->RelativeAngularVel();
                                              ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp: In member function ‘void gazebo::FreeBuoyancyPlugin::ParseNewModel(const ModelPtr&)’:
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:197:78: error: ‘class gazebo::physics::Inertial’ has no member named ‘CoG’
                     new_buoy_link.buoyancy_center = sdf_link->GetInertial()->CoG();
                                                                              ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:198:145: error: ‘class gazebo::physics::Inertial’ has no member named ‘Mass’
                     new_buoy_link.linear_damping = new_buoy_link.angular_damping = 5 * ignition::math::Vector3d::One * sdf_link->GetInertial()->Mass();
                                                                                                                                                 ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:210:92: error: ‘class gazebo::physics::Inertial’ has no member named ‘Mass’
                     new_buoy_link.buoyant_force = -compensation * sdf_link->GetInertial()->Mass() * WORLD_GRAVITY;
                                                                                            ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:234:78: error: ‘class gazebo::physics::Inertial’ has no member named ‘CoG’
                     new_buoy_link.buoyancy_center = sdf_link->GetInertial()->CoG();
                                                                              ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:235:145: error: ‘class gazebo::physics::Inertial’ has no member named ‘Mass’
                     new_buoy_link.linear_damping = new_buoy_link.angular_damping = 5 * ignition::math::Vector3d::One * sdf_link->GetInertial()->Mass();
                                                                                                                                                 ^
/home/farhad/freebuoyancy_gazebo/src/freebuoyancy.cpp:259:92: error: ‘class gazebo::physics::Inertial’ has no member named ‘Mass’
                     new_buoy_link.buoyant_force = -compensation * sdf_link->GetInertial()->Mass() * WORLD_GRAVITY;
                                                                                            ^
CMakeFiles/freebuoyancy_gazebo.dir/build.make:62: recipe for target 'CMakeFiles/freebuoyancy_gazebo.dir/src/freebuoyancy.cpp.o' failed
make[2]: *** [CMakeFiles/freebuoyancy_gazebo.dir/src/freebuoyancy.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/freebuoyancy_gazebo.dir/all' failed
make[1]: *** [CMakeFiles/freebuoyancy_gazebo.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

```

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [May 7, 2021, 12:41pm UTC](https://discuss.bluerobotics.com/t/install-freebuoyancy-gazebo-plugin-problem/9620/2 "2021-05-07T12:41:47Z")

</div>

Hi @mohammad,

You need to use the following repository, branch and instructions:

> **[GitHub - patrickelectric/ardupilot\_gazebo at add\_link](https://github.com/patrickelectric/ardupilot_gazebo/tree/add_link)**
>
> add\_link

---

<div class="post-metadata">

**Author:** ![mohammad](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@mohammad](https://discuss.bluerobotics.com/u/mohammad)\
**Post date:** [May 7, 2021, 7:53pm UTC](https://discuss.bluerobotics.com/t/install-freebuoyancy-gazebo-plugin-problem/9620/3 "2021-05-07T19:53:04Z")

</div>

currently i used gazebo 8 and i dont have error with gazebo but when running sitl i have link 1 down error.  
farhad@farhad:~/ardupilot/ArduSub$ sim\_vehicle.py -f gazebo-bluerov2 -L RATBeach --out=udp:0.0.0.0:14550 --console  
SIM\_VEHICLE: Start  
SIM\_VEHICLE: Killing tasks  
SIM\_VEHICLE: Starting up at 33.810313,-118.393867,0,270 (RATBeach)  
SIM\_VEHICLE: WAF build  
SIM\_VEHICLE: Configure waf  
SIM\_VEHICLE: “/home/farhad/ardupilot/modules/waf/waf-light” “configure” “–board” “sitl”  
Setting top to : /home/farhad/ardupilot  
Setting out to : /home/farhad/ardupilot/build  
Autoconfiguration : enabled  
Setting board to : sitl  
Using toolchain : native  
Checking for ‘g++’ (C++ compiler) : /usr/lib/ccache/g++  
Checking for ‘gcc’ (C compiler) : /usr/lib/ccache/gcc  
Checking for c flags ‘-MMD’ : yes  
Checking for cxx flags ‘-MMD’ : yes  
Checking for need to link with librt : not necessary  
Checking for feenableexcept : yes  
Checking for HAVE\_CMATH\_ISFINITE : yes  
Checking for HAVE\_CMATH\_ISINF : yes  
Checking for HAVE\_CMATH\_ISNAN : yes  
Checking for NEED\_CMATH\_ISFINITE\_STD\_NAMESPACE : yes  
Checking for NEED\_CMATH\_ISINF\_STD\_NAMESPACE : yes  
Checking for NEED\_CMATH\_ISNAN\_STD\_NAMESPACE : yes  
Checking for header endian.h : yes  
Checking for header byteswap.h : yes  
Checking for HAVE\_MEMRCHR : yes  
Checking for program ‘python’ : /usr/bin/python  
Checking for python version \>= 2.7.0 : 2.7.12  
Checking for program ‘python’ : /usr/bin/python  
Checking for python version \>= 2.7.0 : 2.7.12  
Source is git repository : yes  
Update submodules : yes  
Checking for program ‘git’ : /usr/bin/git  
Checking for program ‘size’ : /usr/bin/size  
Benchmarks : disabled  
Unit tests : enabled  
Scripting : enabled  
Scripting runtime checks : enabled  
Checking for program ‘rsync’ : /usr/bin/rsync  
‘configure’ finished successfully (5.765s)  
SIM\_VEHICLE: Building  
SIM\_VEHICLE: “/home/farhad/ardupilot/modules/waf/waf-light” “build” “–target” “bin/ardusub”  
Waf: Entering directory `/home/farhad/ardupilot/build/sitl' Embedding file sandbox.lua:libraries/AP_Scripting/scripts/sandbox.lua Waf: Leaving directory `/home/farhad/ardupilot/build/sitl’

## BUILD SUMMARY Build directory: /home/farhad/ardupilot/build/sitl Target Text Data BSS Total

bin/ardusub 1935763 2912 65312 2003987

Build commands will be stored in build/sitl/compile\_commands.json  
‘build’ finished successfully (6.146s)  
SIM\_VEHICLE: Using defaults from (/home/farhad/ardupilot/Tools/autotest/default\_params/sub.parm)  
SIM\_VEHICLE: Run ArduSub  
SIM\_VEHICLE: “/home/farhad/ardupilot/Tools/autotest/run\_in\_terminal\_window.sh” “ArduSub” “/home/farhad/ardupilot/build/sitl/bin/ardusub” “-S” “-I0” “–home” “33.810313,-118.393867,0,270” “–model” “gazebo-bluerov2” “–speedup” “1” “–defaults” “/home/farhad/ardupilot/Tools/autotest/default\_params/sub.parm”  
SIM\_VEHICLE: Run MavProxy  
SIM\_VEHICLE: “mavproxy.py” “–master” “tcp:127.0.0.1:5760” “–sitl” “127.0.0.1:5501” “–out” “127.0.0.1:14550” “–out” “127.0.0.1:14551” “–out” “udp:0.0.0.0:14550” “–console”  
RiTW: Starting ArduSub : /home/farhad/ardupilot/build/sitl/bin/ardusub -S -I0 --home 33.810313,-118.393867,0,270 --model gazebo-bluerov2 --speedup 1 --defaults /home/farhad/ardupilot/Tools/autotest/default\_params/sub.parm  
Connect tcp:127.0.0.1:5760 source\_system=255  
Loaded module console  
Log Directory:  
Telemetry log: mav.tlog  
Waiting for heartbeat from tcp:127.0.0.1:5760  
MAV\>

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [May 7, 2021, 10:45pm UTC](https://discuss.bluerobotics.com/t/install-freebuoyancy-gazebo-plugin-problem/9620/4 "2021-05-07T22:45:09Z")

</div>

You need to click in the play button on gazebo.
