Vehicle Gateway AERIAL WG
Vehicle Gateway AERIAL WG
Vehicle Gateway AERIAL WG
Alejandro Hernández
Cordero
June 2023
Index
● vehicle_gateway
● Simulation
● Testing
● Multirobot
● Demo world
● zenoh
● Conclusions
Index
● vehicle_gateway
● Simulation
● Testing
● Multirobot
● Demo world
● zenoh
● Conclusions
vehicle_gateway
● The goal of this project is to create a pluginlib-based C++ library that can interface with several
vehicle SDK's.
Vehicle_gateway overview
● The goal of this project is to create a pluginlib-based C++ library that can interface with several
vehicle SDK's.
vehicle_gateway
● The goal of this project is to create a pluginlib-based C++ library that can interface with several
vehicle SDK's.
● Download and install the required target to run Software In The Loop (SITL)
○ Betaflight (Experimental)
○ PX4
$> px4
$> px4-commander
$> betaflight_SITL.elf
vehicle_gateway
● The goal of this project is to create a pluginlib-based C++ library that can interface with several
vehicle SDK's.
● Download and install the required target to run SITL
○ Betaflight (Experimental)
○ PX4
● Download and install ground stations
○ QGroundControl
○ Betaflight configurator
vehicle_gateway
● The goal of this project is to create a pluginlib-based C++ library that can interface with several
vehicle SDK's.
● Download and install the required target to run SITL
○ Betaflight (Experimental)
○ PX4
● Download and install ground stations
○ QGroundControl
○ Betaflight configurator
● vehicle_gateway: A pluginlib-based system for interfacing to vehicle SDK's.
○ vehicle_gateway_betaflight: Betaflight plugin for the Vehicle Gateway.
○ vehicle_gateway_px4: PX4 plugin for the Vehicle Gateway.
vehicle_gateway
● vehicle_gateway is pure CPP without dependencies
○ ROS 2 Humble
● vehicle_gateway_betaflight
○ pluginlib
○ rclcpp
○ sensor_msgs
○ std_msgs
● vehicle_gateway_px4
○ pluginlib
○ rclcpp
○ px4_msgs
○ tf2
○ zenohc
vehicle_gateway
pluginlib::ClassLoader<vehicle_gateway::VehicleGateway> loader;
std::shared_ptr<vehicle_gateway::VehicleGateway> gateway;
gateway_ = this->loader_.createSharedInstance(
"vehicle_gateway_px4::VehicleGatewayPX4");
gateway_->init(0, nullptr);
gateway->arm()
gateway->takeoff()
// do stuff
gateway->land()
gateway->destroy()
vehicle_gateway
/// Arm vehicle
virtual void arm() = 0;
/// VTOL
/// Transition to fixed wings
virtual void transition_to_fw() = 0;
import vehicle_gateway
● Physics
○ Accurate simulation with DART.
○ Plugin system for physics backend.
● Rendering
○ Ogre-Next 2.3 rendering engine (PBR).
○ Plugin system for rendering backend.
● Sensors
○ Rich camera system.
○ Extend with sensor plugins.
● Simulation Engine
○ Extend with system plugins.
● GUI
○ Custom GUI widgets as plugins.
● ROS / ROS 2 integration (ros_gz)
Aerial widgets in Gazebo
● Compass
● Attitude
● Generic plugins
● Improvements:
○ airspeed indicator?
○ takeoff/land/mode buttons?
Simulation
● Requirements
○ ROS 2 Humble
○ Gazebo Garden
○ ros_gz
● PX4
○ px4_sim
■ Launch single vehicle
■ Launch multi vehicle
● Betaflight
○ betaflight_sim
■ Launch single vehicle
■ Launch single vehicle with joystick
○ betaflight_gazebo (Gazebo plugin)
■ UDP connection with Betaflight - send RC commands
Launch files
● drone_id: set the vehicle ID, default=0
● drone_type: Sim Models (x500, standard_vtol, rc_cessna)
● dds_domain: Set DDS_DOMAIN_ID
● sensor_config: Sensor configuration from configs_px4 directory
● frame_name: Frame name included in the SDF world file
● groundcontrol: Start ground control station.
● world_name: World name (without .sdf)
● model_pose: Model pose (x, y, z, roll, pitch, yaw)
Launch
PX4
Launch
Gazebo
ROS 2
Launch
Spawn
Models
px4_sim
PX4
Launch
PX4
LiftDragPlugin
LiftDragPlugin
LiftDragPlugin
Launch
Gazebo
ROS 2
Launch
Spawn
SDF/URDF
Models
px4_sim
XRCE -
ROS 2 DDS MICRO-ROS-AGENT
DDS PX4
/fmu/in/onboard_computer_status
/fmu/in/sensor_optical_flow
/fmu/in/vehicle_command
…
/fmu/out/timesync_status
/fmu/out/vehicle_attitude
/fmu/out/vehicle_control_mode
/fmu/out/vehicle_gps_position
…
betaflight_sim
Betaflight
Launch
Betaflight
LiftDragPlugin
LiftDragPlugin
LiftDragPlugin
Launch
Gazebo
ROS 2
Launch
Spawn
SDF/URDF
Models
betaflight_sim
RC in
Motor out
ROS 2 vehicle_gateway_betaflight
/global_position/rel_alt
/imu/data_raw
/imu/mag
/joy
/joy/set_feedback
/motors_out
Vehicle_gateway_betaflight (demo)
●
Offboard position control
● MC takeoff
● MC hover over pad
● FW transition
● FW loiter
● FW offboard position
○ fly to north waypoint
○ change speed
○ fly to south waypoint
○ fly thome
● FW loiter
● MC transition
● MC hover over pad
● MC land
Offboard body-rate and thrust control
● MC takeoff
● MC hover over pad
● FW transition
● FW loiter
● FW offboard CTBR
○ fly to north waypoint
○ change speed
○ fly to south waypoint
○ fly thome
● FW loiter
● MC transition
● MC hover over pad
● MC land
Index
● vehicle_gateway
● Simulation
● Testing
● Multirobot
● Demo world
● zenoh
● Conclusions
Testing - vehicle_gateway_integration_test
● End to end testing
● Gazebo headless mode
included_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[os.path.join(get_package_share_directory('ros_gz_sim'),
'launch', 'gz_sim.launch.py')]),
launch_arguments=[('gz_args', [gz_args])]
)
Testing - vehicle_gateway_integration_test
● End to end testing
● Gazebo headless mode
● Python script with the test
○ arm/disarm
○ takeoff/land
● Check outputs
launch_testing.asserts.assertExitCodes(proc_info, process=run_px4,
allowable_exit_codes=[0])
Testing
launch_testing
Launch
PX4
Launch
Gazebo
ROS 2 test
Launch
Spawn
Models
Testing
launch_testing
PX4
Launch
PX4
LiftDragPlugin
LiftDragPlugin
LiftDragPlugin
Launch
Gazebo
ROS 2
Launch
Spawn
SDF/URDF
Models
Testing
launch_testing
XRCE -
ROS 2 DDS MICRO-ROS-AGENT
DDS PX4
- vehicle_id: 1
frame_name: pad_1
vehicle_type: x500
sensor_config: stock
model_pose: ""
dds_domain_id: 1
- vehicle_id: 2
frame_name: pad_2
vehicle_type: standard_vtol
sensor_config: stock
model_pose: ""
dds_domain_id: 2
multirobot
● PX4 only:
○ Quads
○ Fixed wing planes
○ VTOLs
● Spawn robot and generate namespaced topics/services
● YAML file to configure your simulation
● Launch file
export MULTIROBOT_CONFIG=<path_to_config_file>/multirobot_config.yaml
ros2 launch px4_sim px4_sim_multi.launch.py
Index
● vehicle_gateway
● Simulation
● Testing
● Multirobot
● Demo world
● zenoh
● Conclusions
World
● several helipads
○ future formation flight, etc
● one runway
● (0, 0) lat/lon
○ avoid confidential data
● sand material 🏝
● wave-effect shader ✨
● What’s next?
○ Boats ?
○ Rovers ?
Feedback:
● We invite everyone to try it and test it! We are happy to receive your feedback and contributions
Thank you!