Skip to content

Commit

Permalink
Patch sitl_gazebo to make Gazebo not crash on deleting the model
Browse files Browse the repository at this point in the history
  • Loading branch information
okalachev committed Jun 10, 2022
1 parent 28b1f0d commit ad2a6cb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 26 deletions.
60 changes: 34 additions & 26 deletions assets/patches/sitl_gazebo.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
diff --git a/cmake/FindMAVLink.cmake b/cmake/FindMAVLink.cmake
index 8de3079..3fdae02 100644
--- a/cmake/FindMAVLink.cmake
+++ b/cmake/FindMAVLink.cmake
@@ -19,6 +19,7 @@ set(_MAVLINK_EXTRA_SEARCH_HINTS
${CMAKE_SOURCE_DIR}/mavlink/
../../mavlink/
../mavlink/
+ $ENV{HOME}/PX4-Autopilot/mavlink/include
${CATKIN_DEVEL_PREFIX}/
)
diff --git a/src/gazebo_gps_plugin.cpp b/src/gazebo_gps_plugin.cpp
index 1195f5e..6540596 100644
--- a/src/gazebo_gps_plugin.cpp
+++ b/src/gazebo_gps_plugin.cpp
@@ -41,7 +41,6 @@ GpsPlugin::~GpsPlugin()
if (updateSensorConnection_)
updateSensorConnection_->~Connection();
parentSensor_.reset();
- world_->Reset();
}

void GpsPlugin::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf)
diff --git a/src/gazebo_groundtruth_plugin.cpp b/src/gazebo_groundtruth_plugin.cpp
index 441ebd9..dd66e12 100644
--- a/src/gazebo_groundtruth_plugin.cpp
+++ b/src/gazebo_groundtruth_plugin.cpp
@@ -51,7 +51,6 @@ GroundtruthPlugin::~GroundtruthPlugin()
{
if (updateConnection_)
updateConnection_->~Connection();
- world_->Reset();
}

diff --git a/package.xml b/package.xml
index ae0fb34..12f17b8 100644
--- a/package.xml
+++ b/package.xml
@@ -50,8 +50,8 @@
<build_depend>roscpp</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
- <build_depend>python-rospkg</build_depend>
- <build_depend>python-jinja2</build_depend>
+ <build_depend>python3-rospkg</build_depend>
+ <build_depend>python3-jinja2</build_depend>
<run_depend>eigen</run_depend>
<run_depend>gazebo_ros</run_depend>
<run_depend>geometry_msgs</run_depend>
void GroundtruthPlugin::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
diff --git a/src/gazebo_lidar_plugin.cpp b/src/gazebo_lidar_plugin.cpp
index 38374e6..1b2fbf8 100644
--- a/src/gazebo_lidar_plugin.cpp
+++ b/src/gazebo_lidar_plugin.cpp
@@ -47,7 +47,6 @@ LidarPlugin::~LidarPlugin()
newLaserScansConnection_->~Connection();
newLaserScansConnection_.reset();
parentSensor_.reset();
- world_->Reset();
}

/////////////////////////////////////////////////
5 changes: 5 additions & 0 deletions scripts/install_software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ echo "--- Installing PX4 dependencies"
pip3 install --user toml
sudo -E sh -c 'apt-get install -y ant openjdk-11-jdk' # Additional packages for jMAVSim

echo "--- Patching mavlink_sitl_gazebo"
# See https://github.com/PX4/PX4-SITL_gazebo/pull/872
cd ~/PX4-Autopilot/Tools/sitl_gazebo
patch -p1 < /tmp/patches/mavlink_sitl_gazebo.patch

echo "--- Addding Gazebo initialization to bashrc"
echo "source /usr/share/gazebo/setup.sh" >> ~/.bashrc
echo "export SVGA_VGPU10=0" >> ~/.bashrc
Expand Down

0 comments on commit ad2a6cb

Please sign in to comment.