mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-01 17:00:34 +08:00
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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user