# Physical GPS but with dump measures?

**URL:** <https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015>\
**Category:** PX4 Autopilot\
**Created:** [February 2, 2022, 1:46pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015 "2022-02-02T13:46:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuSevRo](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/8e8cbc/32.png) [@JuSevRo](https://discuss.px4.io/u/JuSevRo)\
**Post date:** [February 2, 2022, 1:46pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015/1 "2022-02-02T13:46:55Z")

</div>

Hello!  
I would like to know if it is possible to carry on board a GPS but not using the data obtained by it. I mean, I would like to implement a no-GPS offboard mission for my SITL drone, so, i need the pyhisical existance of a GPS (for the offboard preflight checkings), but i don’t want it to be the position sensor, since I want to do vision offboard.

Would it be possible to do that?

Thanks

---

<div class="post-metadata">

**Author:** ![jimdgit](https://discuss.px4.io/user_avatar/discuss.px4.io/jimdgit/32/6860_2.png) [@jimdgit](https://discuss.px4.io/u/jimdgit)\
**Post date:** [February 2, 2022, 3:12pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015/2 "2022-02-02T15:12:40Z")

</div>

If you are not in position or mission mode the GPS is not used.  
If you are in offboard mode, then it is not used.

> **[Offboard Mode | PX4 User Guide](https://docs.px4.io/master/en/flight_modes/offboard.html)**
>
> PX4 is the Professional Autopilot. Developed by world-class developers from industry and academia, and supported by an active world wide community, it powers all kinds of vehicles from racing and cargo drones through to ground vehicles and...

---

<div class="post-metadata">

**Author:** ![JuSevRo](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/8e8cbc/32.png) [@JuSevRo](https://discuss.px4.io/u/JuSevRo)\
**Post date:** [February 2, 2022, 3:25pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015/3 "2022-02-02T15:25:07Z")

</div>

Hello @jimdgit , and first of all, thanks for your quick answer.  
Then, if I eliminate the GPS plugin and joint from the iris.sdf file for example, and the run the offboard.cpp to iris\_opt\_flow, should it work? Because at that point is where i am getting stuck.

---

<div class="post-metadata">

**Author:** ![jimdgit](https://discuss.px4.io/user_avatar/discuss.px4.io/jimdgit/32/6860_2.png) [@jimdgit](https://discuss.px4.io/u/jimdgit)\
**Post date:** [February 2, 2022, 4:18pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015/4 "2022-02-02T16:18:28Z")

</div>

Should what work? What are you expecting to happen.

---

<div class="post-metadata">

**Author:** ![JuSevRo](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/8e8cbc/32.png) [@JuSevRo](https://discuss.px4.io/u/JuSevRo)\
**Post date:** [February 2, 2022, 4:29pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015/5 "2022-02-02T16:29:55Z")

</div>

I am expecting the drone to perform the offboard path in offboard.cpp. When I eliminate from the iris sdf file the GPS joint and plugin, the drone does not take off, and the terminal keeps printing the following message:  
 ![image](https://discuss.px4.io/uploads/default/original/2X/f/ff5a1f35074fda8a06470f1c5eeddd13466c3240.png)  
If I don’t eliminate those features from the sdf, the .cpp runs properly and the drone performs the path.

---

<div class="post-metadata">

**Author:** ![jimdgit](https://discuss.px4.io/user_avatar/discuss.px4.io/jimdgit/32/6860_2.png) [@jimdgit](https://discuss.px4.io/u/jimdgit)\
**Post date:** [February 2, 2022, 5:20pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015/6 "2022-02-02T17:20:53Z")

</div>

Why are you removing the GPS? Once you enter offboard mode the GPS is not used.  
BTW offboard.cpp just accepts offboard commands.  
Your code needs to send off board commands to navigate the drone.

---

<div class="post-metadata">

**Author:** ![JuSevRo](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/8e8cbc/32.png) [@JuSevRo](https://discuss.px4.io/u/JuSevRo)\
**Post date:** [February 3, 2022, 12:47pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015/7 "2022-02-03T12:47:18Z")

</div>

As far as I know the offboard mode needs position information, it is stated in the px4 wiki that ‘this mode requires position or pose/altitude information - e.g. GPS, optical flow, visual-inertial odometry, mocap, etc’. How do you know that, if the model has a GPS, it is not using it for gathering position info in the offboarf mode?

Regarding offboard.cpp, the example commands are already provided in the script. I was just trying that example that already performs several commands such as flying circles, etc. No extra commands were needed to be sent since the cpp already had numerous.

---

<div class="post-metadata">

**Author:** ![jimdgit](https://discuss.px4.io/user_avatar/discuss.px4.io/jimdgit/32/6860_2.png) [@jimdgit](https://discuss.px4.io/u/jimdgit)\
**Post date:** [February 3, 2022, 1:31pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015/8 "2022-02-03T13:31:22Z")

</div>

“As far as I know the offboard mode needs position information,”, yes but if you set it to proper mode you are required to provide the position.

```auto
void OffboardControl::publish_offboard_control_mode() const {
	OffboardControlMode msg{};
	msg.timestamp = timestamp_.load();
	msg.position = true; >> This means you will provide position,
	msg.velocity = false;
	msg.acceleration = false;
	msg.attitude = false;
	msg.body_rate = false;

	offboard_control_mode_publisher_->publish(msg);
}

```

---

<div class="post-metadata">

**Author:** ![JuSevRo](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/8e8cbc/32.png) [@JuSevRo](https://discuss.px4.io/u/JuSevRo)\
**Post date:** [February 3, 2022, 3:05pm UTC](https://discuss.px4.io/t/physical-gps-but-with-dump-measures/26015/9 "2022-02-03T15:05:00Z")

</div>

Although I understand what you mean, that code belongs to the ROS offboard example, however I am trying to run the MAVSDK example, that is the one that gets stucked in ‘Waiting for system to be ready’ when I remove the GPS.

I mean, I am running the same MAVSDK offboard example for both, GPS and no GPS Iris, and only when I remove GPS the running gets stucked.
