Initial plane heading for sitl simulation

Hi,

For sitl simulations (with Gazebo in my case), is there a way to set the initial heading of the plane?

I know you can use “export PX4_HOME_LAT/export PX4_HOME_LON” for the initial position, but can’t find any documentation on environment variables for px4 sitl simulations

@Aeris The model is spawned here: PX4-Autopilot/sitl_run.sh at c5fb68b7a1a9ba7ff7cd241de8c346d6c5f424ff · PX4/PX4-Autopilot · GitHub and you can set the default pose by editing the commands.

1 Like

The command seems to only include x,y,z coordinates, not attitude angles. Would I need to change the .sdf model file?

@Aeris gz model has a command line arguement for poses too

Okay figured it out. Thank you so much!

I’ve been looking for this for awhile. What was the change needed to adjust the pose?

You change the line pointed out by Jaeyoung-Lim. After -x -y -z you can add arguments for the pose. The one for yaw is -Y in radians. Here’s a link the documentation for the gz model function:
http://manpages.ubuntu.com/manpages/bionic/man1/gz.1.html

-x, –pose-x arg x value -y, –pose-y arg y value -z, –pose-z arg z value -R, –pose-R arg roll in radians. -P, –pose-P arg pitch in radians. -Y, –pose-Y arg yaw in radians.