Mavros+PX4+QGC How to set home

Hello,
i have an autonomous mission code and it works well in Swiss(default home position).
I want to set home position using python. I tried" export PX4_HOME_LAT/LON " command from ubuntu terminal but nothing has changed, still starts from the same location. According to my researchs, it looks like i have to do that using python code and mavros commands, but i don’t know how to do that.

1 Like

I think you have to send the command to px4 FCU. You can use mavros command service - set_home using rosservice from terminal or write it from a python ros script

2 Likes

rosservice call /mavros/cmd/set_home “{current_gps: false, yaw: 0.0, latitude: 13.589722, longitude: 80.003377, altitude: 8.0}”
success: False
result: 1

why it is failing. what wrong am i doing here

Did you find how to use this?

How i will ensure that my set home done in PX4/FCU ?

How will i ensure that my set home is done in PX4 and what the value set in PX4/FCU?