diff --git a/README.md b/README.md index ec141ca026..7b8f53aa3c 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,15 @@ We have tested the firmware only with Pixracer. If you have flash memory issues More detailed guide will be incrementally added here. Please reach us directly or submit an issue on this repository if you have specific questions, concerns, feedback or bug reports. -The files for the Gazebo simulation model and detailed guide on compiling for SITL will be added here by the end of November 2020. +To simulate using gazebo, you need to add the model and the world of your fully-actuated UAV to the firmware. Optionally you can modify the model files for our hexarotor (with all arms tilted for 30 degrees). + +To enable simulation for our multirotor, copy the contents of the `world` and `model` folders from `sitl_gazebo_fully_actuated` to the `world` and `model` folders in `Tools/sitl_gazebo`. Now you can run the SITL simulation of our UAV using the following command: + +``` +make px4_sitl gazebo_hexa_x_tilt +``` + +If you get `gazebo_opticalflow_plugin.h:43:18: error: ‘TRUE’ was not declared in this scope`, simply replace `TRUE` with `true` in `Tools/sitl_gazebo/include/gazebo_opticalflow_plugin.h` line 43. ### Disclaimer diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/hexa_x_tilt.sdf b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/hexa_x_tilt.sdf new file mode 100755 index 0000000000..29c4e62e20 --- /dev/null +++ b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/hexa_x_tilt.sdf @@ -0,0 +1,1613 @@ + + + + + 0 0 0.26 0 0 3.1415927 + + 0 0 0 0 0 0 + + + + 0.001005 0 -0.0090035 0 0 0 + 2.02 + + 0.011 + 0 + 0 + 0.015 + 0 + 0.021 + + + + 0 0 0.0 0 0 0 + + + 0.67 0.67 0.15 + + + + + + 0.001 + 0 + + + + + + + + + 0 0 0 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/main_body_remeshed_v3.stl + + + + + + + + 1 + + 0 + + + + + + -0.041 0 -0.162 0 0 0 + 0.1 + + 0.001 + 0 + 0 + 0.001 + 0 + 0.001 + + + + 0 0 0 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/cgo3_mount_remeshed_v1.stl + + + + + + + + + cgo3_mount_link + base_link + 0 0 0 0 0 0 + + 0 0 1 + + 0 + 0 + 100 + -1 + + + 1 + + 1 + + + + 1 + + + + + + + + -0.041 0 -0.162 0 0 0 + 0.1 + + 0.001 + 0 + 0 + 0.001 + 0 + 0.001 + + + + 0 0 0 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/cgo3_vertical_arm_remeshed_v1.stl + + + + + + + + + cgo3_vertical_arm_link + cgo3_mount_link + -0.026 0 -0.10 0 0 0 + + + 0 0 1 + + -1e16 + 1e16 + 100 + -1 + + + 0.1 + + 1 + + + + 1 + + + 0.1 + 0.2 + + + + + + + + + -0.041 0 -0.081 0 0 0 + 0.1 + + 0.001 + 0 + 0 + 0.001 + 0 + 0.001 + + + + 0 0 0 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/cgo3_horizontal_arm_remeshed_v1.stl + + + + + + + + + cgo3_horizontal_arm_link + cgo3_vertical_arm_link + 0.026 0 -0.162 0 0 0 + + + -1 0 0 + + -0.785398 + 0.785398 + 100 + -1 + + + 0.1 + + 1 + + + + 1 + + + 0.1 + 0.2 + + + + + + + + + + + + 0 -0.14314 -0.207252 0 0 0 + 0.1 + + 0.001 + 0 + 0 + 0.001 + 0 + 0.001 + + + + -0.005 -0.14314 -0.207252 0 1.56893 0 + + + 0.012209 + 0.3 + + + + + + 1 + 1 + + + + + 1e+8 + 1 + 0.01 + 0.001 + + + + + + 0.00052 -0.08503 -0.121187 -0.501318 0 0 + + + 0.00914984 + 0.176893 + + + + + + 1 + 1 + + + + + 1e+8 + 1 + 0.01 + 0.001 + + + + + + 0 0 0 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/leg2_remeshed_v3.stl + + + + + + + + + left_leg + base_link + 0.00026 -0.040515 -0.048 0 0 0 + + -1 0 0 + + 0 + 1 + 100 + -1 + 100000000 + 1 + + + 0.1 + + 1 + + + + 1 + + + + + + 0 0 0 0 0 0 + + + 0 0.14314 -0.207252 0 0 0 + 0.1 + + 0.001 + 0 + 0 + 0.001 + 0 + 0.001 + + + + -0.005 0.14314 -0.207252 0 1.56893 0 + + + 0.012209 + 0.3 + + + + + + 1 + 1 + + + + + 1e+8 + 1 + 0.01 + 0.001 + + + + + + 0.00052 0.08503 -0.121187 0.501318 0 0 + + + 0.00914984 + 0.176893 + + + + + + 1 + 1 + + + + + 1e+8 + 1 + 0.01 + 0.001 + + + + + + 0 0 0 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/leg1_remeshed_v3.stl + + + + + + + + + right_leg + base_link + 0.00026 0.040515 -0.048 0 0 0 + + 1 0 0 + + 0 + 1 + 100 + -1 + 100000000 + 1 + + + 0.1 + + 1 + + + + 1 + + + + + + 0 0 0 0 0 3.1415927 + + 0 0 0 0 0 0 + 0.015 + + 1e-05 + 0 + 0 + 1e-05 + 0 + 1e-05 + + + + + hexa_x_tilt/imu_link + base_link + + 1 0 0 + + 0 + 0 + 0 + 0 + + + 0 + 0 + + 1 + + + + 0.211396 0.119762 0.082219 0 0.52 -1.04 + + 0 0 0 0 0 0 + 0.005 + + 9.75e-07 + 0 + 0 + 0.000273104 + 0 + 0.000274004 + + + + + -0.211396 -0.119762 -0.082219 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/prop_ccw_assembly_remeshed_v3.stl + + + + + + + 1 + + 0 + + + rotor_3 + base_link + + 0.251 -0.428 0.867 + + -1e+16 + 1e+16 + 10 + -1 + + + 0.005 + + 1 + + + + 1 + + + + + -0.209396 0.122762 0.082219 0.0 0.52 1.04 + + 0 0 0 0 0 0 + 0.005 + + 9.75e-07 + 0 + 0 + 0.000273104 + 0 + 0.000274004 + + + + + -0.211396 -0.119762 -0.082219 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/prop_ccw_assembly_remeshed_v3.stl + + + + + + + 1 + + 0 + + + rotor_0 + base_link + + 0.25 0.42 0.86 + + -1e+16 + 1e+16 + 10 + -1 + + + 0.005 + + 1 + + + + 1 + + + + + -0.00187896 0.242705 0.0822169 0 -0.52 0 + + 0 0 0 0 0 0 + 0.005 + + 9.75e-07 + 0 + 0 + 0.000273104 + 0 + 0.000274004 + + + + 0 0 0 0 0 0 + + + 0.005 + 0.128 + + + + + + + + + + + + + 0.00187896 -0.242705 -0.0822169 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/prop_cw_assembly_remeshed_v3.stl + + + + + + + 1 + + 0 + + + rotor_4 + base_link + + -0.5 0.0 0.867 + + -1e+16 + 1e+16 + 10 + -1 + + + 0.005 + + 1 + + + + 1 + + + + + 0.211396 -0.119762 0.082219 0 -0.52 -2.09439510239 + + 0 0 0 0 0 0 + 0.005 + + 9.75e-07 + 0 + 0 + 0.000273104 + 0 + 0.000274004 + + + + 0 0 0 0 0 0 + + + 0.005 + 0.128 + + + + + + + + + + + + + 0.00187896 -0.242705 -0.0822169 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/prop_cw_assembly_remeshed_v3.stl + + + + + + + 1 + + 0 + + + rotor_1 + base_link + + 0.251 0.428 0.867 + + -1e+16 + 1e+16 + 10 + -1 + + + 0.005 + + 1 + + + + 1 + + + + + + -0.00187896 -0.242705 0.0822169 0 0.52 -3.1415 + + 0 0 0 0 0 0 + 0.005 + + 9.75e-07 + 0 + 0 + 0.000273104 + 0 + 0.000274004 + + + + + -0.211396 -0.119762 -0.082219 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/prop_ccw_assembly_remeshed_v3.stl + + + + + + + 1 + + 0 + + + rotor_5 + base_link + + -0.5 0.0 0.867 + + -1e+16 + 1e+16 + 10 + -1 + + + 0.005 + + 1 + + + + 1 + + + + + -0.209396 -0.122762 0.082219 0 -0.52 2.09439510239 + + 0 0 0 0 0 0 + 0.005 + + 9.75e-07 + 0 + 0 + 0.000273104 + 0 + 0.000274004 + + + + 0 0 0 0 0 0 + + + 0.005 + 0.128 + + + + + + + + + + + + + 0.00187896 -0.242705 -0.0822169 0 0 0 + + + 0.001 0.001 0.001 + model://hexa_x_tilt/meshes/prop_cw_assembly_remeshed_v3.stl + + + + + + + 1 + + 0 + + + rotor_2 + base_link + + 0.25 -0.42 0.86 + + -1e+16 + 1e+16 + 10 + -1 + + + 0.005 + + 1 + + + + 1 + + + + + + + + + + + base_link + 10 + + + + rotor_0_joint + rotor_0 + ccw + 0.0125 + 0.025 + 1500 + 8.54858e-06 + 0.06 + /gazebo/command/motor_speed + 4 + 0.000806428 + 1e-06 + /motor_speed/4 + 10 + + + + + rotor_1_joint + rotor_1 + cw + 0.0125 + 0.025 + 1500 + 8.54858e-06 + 0.06 + /gazebo/command/motor_speed + 5 + 0.000806428 + 1e-06 + /motor_speed/5 + 10 + + + + + rotor_2_joint + rotor_2 + cw + 0.0125 + 0.025 + 1500 + 8.54858e-06 + 0.06 + /gazebo/command/motor_speed + 2 + 0.000806428 + 1e-06 + /motor_speed/2 + 10 + + + + + rotor_3_joint + rotor_3 + ccw + 0.0125 + 0.025 + 1500 + 8.54858e-06 + 0.06 + /gazebo/command/motor_speed + 3 + 0.000806428 + 1e-06 + /motor_speed/3 + 10 + + + + + rotor_4_joint + rotor_4 + cw + 0.0125 + 0.025 + 1500 + 8.54858e-06 + 0.06 + /gazebo/command/motor_speed + 0 + 0.000806428 + 1e-06 + /motor_speed/0 + 10 + + + + + rotor_5_joint + rotor_5 + ccw + 0.0125 + 0.025 + 1500 + 8.54858e-06 + 0.06 + /gazebo/command/motor_speed + 1 + 0.000806428 + 1e-06 + /motor_speed/1 + 10 + + + + + true + + + + 100 + 0.0004 + 6.4e-06 + 600 + /mag + + + + 50 + /baro + + + + /imu + /gps + /mag + /baro + INADDR_ANY + 14560 + false + /dev/ttyACM0 + 921600 + INADDR_ANY + 14550 + INADDR_ANY + 14540 + false + false + true + true + /gazebo/command/motor_speed + + + 0 + 0 + 1500 + 0 + 100 + velocity + + rotor_4_joint + + + 1 + 0 + 1500 + 0 + 100 + velocity + + rotor_5_joint + + + 2 + 0 + 1500 + 0 + 100 + velocity + + rotor_2_joint + + + 3 + 0 + 1500 + 0 + 100 + velocity + + rotor_3_joint + + + 4 + 0 + 1500 + 0 + 100 + velocity + + rotor_0_joint + + + 5 + 0 + 1500 + 0 + 100 + velocity + + rotor_1_joint + + + + 9 + 1 + 0.5 + 0 + 0 + position + +

3.5

+ 0.5 + 0 + 4 + -4 + 6 + -6 +
+ left_leg_joint +
+ + 10 + 1 + 0.5 + 0 + 0 + position + +

3.5

+ 0.5 + 0 + 4 + -4 + 6 + -6 +
+ right_leg_joint +
+
+
+ 0 + + + hexa_x_tilt/imu_link + /imu + 0.0003394 + 3.8785e-05 + 1000.0 + 0.0087 + 0.004 + 0.006 + 300.0 + 0.196 + + + + base_link + base_link + + 0 0 0 + 0 1 0 + 0 + 0 0 0 + 0 + 0 + 0 + + +
+
+ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_camera_remeshed_v1.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_camera_remeshed_v1.stl new file mode 100755 index 0000000000..d5f6f5861c Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_camera_remeshed_v1.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_horizontal_arm_remeshed_v1.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_horizontal_arm_remeshed_v1.stl new file mode 100755 index 0000000000..fb9e76c07c Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_horizontal_arm_remeshed_v1.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_mount_remeshed_v1.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_mount_remeshed_v1.stl new file mode 100755 index 0000000000..ed383a76e9 Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_mount_remeshed_v1.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_vertical_arm_remeshed_v1.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_vertical_arm_remeshed_v1.stl new file mode 100755 index 0000000000..438b87d4e9 Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/cgo3_vertical_arm_remeshed_v1.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/leg1_remeshed_v3.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/leg1_remeshed_v3.stl new file mode 100755 index 0000000000..49e5ff5255 Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/leg1_remeshed_v3.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/leg2_remeshed_v3.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/leg2_remeshed_v3.stl new file mode 100755 index 0000000000..86b848541d Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/leg2_remeshed_v3.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/main_body_remeshed_v3.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/main_body_remeshed_v3.stl new file mode 100755 index 0000000000..1d5e7c11f5 Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/main_body_remeshed_v3.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/prop_ccw_assembly_remeshed_v3.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/prop_ccw_assembly_remeshed_v3.stl new file mode 100755 index 0000000000..a154d1cb16 Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/prop_ccw_assembly_remeshed_v3.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/prop_cw_assembly_remeshed_v3.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/prop_cw_assembly_remeshed_v3.stl new file mode 100755 index 0000000000..5bb868bebc Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/prop_cw_assembly_remeshed_v3.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/prop_guard_jybhz.stl b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/prop_guard_jybhz.stl new file mode 100755 index 0000000000..123313c505 Binary files /dev/null and b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/meshes/prop_guard_jybhz.stl differ diff --git a/sitl_gazebo_fully_actuated/models/hexa_x_tilt/model.config b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/model.config new file mode 100755 index 0000000000..2fb0e1f07a --- /dev/null +++ b/sitl_gazebo_fully_actuated/models/hexa_x_tilt/model.config @@ -0,0 +1,16 @@ + + + Tilt-Hex + 1.0 + hexa_x_tilt.sdf + + + Azarakhsh Keipour + keipour@cmu.edu + + + + This is a model of omnidirectional hexarotor with tilted rotors. + + + diff --git a/sitl_gazebo_fully_actuated/worlds/hexa_x_tilt.world b/sitl_gazebo_fully_actuated/worlds/hexa_x_tilt.world new file mode 100755 index 0000000000..802d7b4048 --- /dev/null +++ b/sitl_gazebo_fully_actuated/worlds/hexa_x_tilt.world @@ -0,0 +1,52 @@ + + + + + + model://sun + + + + model://ground_plane + + + model://hexa_x_tilt + + + model://asphalt_plane + + + 0 0 -9.8066 + + + quick + 50 + 1.0 + 0 + + + 0 + 0.2 + 100 + 0.001 + + + 0.004 + 1 + 250 + 6.0e-6 2.3e-5 -4.2e-5 + + + +