mirror of
https://github.com/CopterExpress/clover_vm.git
synced 2026-05-26 07:07:58 +00:00
scripts: Patch PX4 SITL package
This commit is contained in:
BIN
assets/packages/monkey_1.6.9-1_amd64.deb
Normal file
BIN
assets/packages/monkey_1.6.9-1_amd64.deb
Normal file
Binary file not shown.
40
assets/patches/sitl_gazebo.patch
Normal file
40
assets/patches/sitl_gazebo.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
diff --git a/include/gazebo_opticalflow_plugin.h b/include/gazebo_opticalflow_plugin.h
|
||||
index 4fbeab2..18a192b 100644
|
||||
--- a/include/gazebo_opticalflow_plugin.h
|
||||
+++ b/include/gazebo_opticalflow_plugin.h
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "flow_px4.hpp"
|
||||
|
||||
#define DEFAULT_RATE 20
|
||||
-#define HAS_GYRO TRUE
|
||||
+#define HAS_GYRO true
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
diff --git a/src/gazebo_geotagged_images_plugin.cpp b/src/gazebo_geotagged_images_plugin.cpp
|
||||
index 050558f..7029199 100644
|
||||
--- a/src/gazebo_geotagged_images_plugin.cpp
|
||||
+++ b/src/gazebo_geotagged_images_plugin.cpp
|
||||
@@ -581,7 +581,8 @@ void GeotaggedImagesPlugin::_send_capture_status(struct sockaddr* srcaddr)
|
||||
0, // video status (Idle)
|
||||
interval, // image interval
|
||||
0, // recording_time_s
|
||||
- available_mib); // available_capacity
|
||||
+ available_mib, // available_capacity
|
||||
+ _imageCounter);
|
||||
_send_mavlink_message(&msg, srcaddr);
|
||||
}
|
||||
|
||||
diff --git a/src/gazebo_mavlink_interface.cpp b/src/gazebo_mavlink_interface.cpp
|
||||
index 5d29017..d4dd6a7 100644
|
||||
--- a/src/gazebo_mavlink_interface.cpp
|
||||
+++ b/src/gazebo_mavlink_interface.cpp
|
||||
@@ -1039,7 +1039,7 @@ void GazeboMavlinkInterface::VisionCallback(OdomPtr& odom_message) {
|
||||
|
||||
odom.time_usec = odom_message->time_usec();
|
||||
|
||||
- odom.frame_id = MAV_FRAME_VISION_NED;
|
||||
+ odom.frame_id = 16 /*MAV_FRAME_VISION_NED*/;
|
||||
odom.child_frame_id = MAV_FRAME_BODY_FRD;
|
||||
|
||||
odom.x = position.X();
|
||||
@@ -47,6 +47,16 @@
|
||||
"source": "{{user `assetsDir`}}/desktop/",
|
||||
"destination": "/home/clever/Desktop"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{user `assetsDir`}}/packages",
|
||||
"destination": "/tmp"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{user `assetsDir`}}/patches",
|
||||
"destination": "/tmp"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"script": "scripts/installSoftware.sh",
|
||||
|
||||
@@ -28,11 +28,10 @@ echo "${PASSWORD}" | sudo -E -S sh -c 'echo "2" | update-alternatives --config j
|
||||
echo "${PASSWROD}" | sudo -E -S sed -i -e '/^assistive_technologies=/s/^/#/' /etc/java-*-openjdk/accessibility.properties
|
||||
|
||||
echo "--- Prebuilding PX4 SITL configuration"
|
||||
make -C /home/clever/Firmware px4_sitl
|
||||
make -C ${HOME}/Firmware px4_sitl
|
||||
echo "--- Patching gazebo plugins for SITL"
|
||||
sed -i 's/TRUE/true/g' ${HOME}/Firmware/Tools/sitl_gazebo/include/gazebo_opticalflow_plugin.h
|
||||
# workaround for frames being deleted
|
||||
sed -i 's/MAV_FRAME_VISION_NED/16 \/\*MAV_FRAME_VISION_NED\*\//g' ${HOME}/Firmware/Tools/sitl_gazebo/src/gazebo_mavlink_interface.cpp
|
||||
cd ${HOME}/Tools/sitl_gazebo
|
||||
patch -p1 < /tmp/patches/sitl_gazebo.patch
|
||||
echo 'export SVGA_VGPU10=0' >> /home/clever/Firmware/Tools/setup_gazebo.bash
|
||||
|
||||
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
|
||||
|
||||
Reference in New Issue
Block a user