px4sim

Crates.iopx4sim
lib.rspx4sim
version0.1.6
sourcesrc
created_at2024-10-10 19:24:29.863786
updated_at2024-10-15 21:52:56.73432
descriptionA wrapper to simplify creating a custom PX4 SITL simulator.
homepage
repositoryhttps://codeberg.org/balint/px4sim-rs
max_upload_size
id1404183
size34,569
(balintbarna)

documentation

README

PX4 SITL Simulation Utility

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.

PX4 SITL Setup

  1. Clone PX4
  2. Install dependencies
  3. Build with make px4_sitl
  4. Launch with 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.

Start PX4 as a Child Process

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.

Commit count: 0

cargo fmt