Physical GPS but with dump measures?

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

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.

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.

Should what work? What are you expecting to happen.

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
If I don’t eliminate those features from the sdf, the .cpp runs properly and the drone performs the path.

1 Like

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.

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.

“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.

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);
}

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.