Crates.io | px4sim |
lib.rs | px4sim |
version | 0.1.6 |
source | src |
created_at | 2024-10-10 19:24:29.863786 |
updated_at | 2024-10-15 21:52:56.73432 |
description | A wrapper to simplify creating a custom PX4 SITL simulator. |
homepage | |
repository | https://codeberg.org/balint/px4sim-rs |
max_upload_size | |
id | 1404183 |
size | 34,569 |
A simple Rust program that fulfills the contracts of a PX4 SITL Simulator the same way as Gazebo or jMavSim.
This library makes it simple to send and receive simulation related information to PX4 via MAVLink. It does not cover other use-cases like offboard control, ground station or remote controller, purely what is needed for PX4 to play nicely with a custom simulator.
make px4_sitl
PX4_SYS_AUTOSTART=<AIRFRAME> ./px4 -i <SYSTEM_ID>
See available airframes in px4/ROMFS/px4fmu_common/init.d-posix/airframes
The airframe value is a number, such as 10016
.
The instance or system ID is a unique number for each running instance of PX4.
It can just be 0
if there is only one running instance.
If the airframe value and the path to the PX4 root directory are provided to the DroneSimulator
class constructor,
it will start the PX4 SITL simulation in the background.
It can also be started programatically using the start_px4
function from the util
module.
This way it is not necessary to start PX4 from a separate console window.
The downside is that the pxh>
shell will not be available to give commands to PX4 from the console window.
The child process shall be killed when exiting.