removal of PX4_GZ_MODEL env variable and fix of ground glitching (#22400)

Removal of PX4_GZ_MODEL env variable and fix of ground glitching

Signed-off-by: frederik <frederik@auterion.com>
Co-authored-by: frederik <frederik@auterion.com>
Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
This commit is contained in:
Frederik Markus
2023-11-29 10:08:04 +01:00
committed by GitHub
parent 59abab8379
commit f00d97d974
2 changed files with 10 additions and 31 deletions
@@ -95,6 +95,12 @@ int GZBridge::init()
model_pose_v.push_back(0.0);
}
// If model position z is less equal than 0, move above floor to prevent floor glitching
if (model_pose_v[2] <= 0.0) {
PX4_INFO("Model position z is less or equal 0.0, moving upwards");
model_pose_v[2] = 1.0;
}
gz::msgs::Pose *p = req.mutable_pose();
gz::msgs::Vector3d *position = p->mutable_position();
position->set_x(model_pose_v[0]);