Hi,
I have a ZED 2i camera mounted on an e-scooter driving through sidewalks. I am using the cloud points to calculate widths and slopes of the sidewalks.
Everything is fine with the widths, but with the slopes I keep getting errors, I think it’s due to the rotation of my point clouds. As the camera is not completely aligned with the ground, as it is placed looking a bit downwards, it has a certain initial angle that can be corrected by rotating the point cloud.
Well, I use the positional_tracking_parameters in order to rotate this point clouds, i am using this:
positional_tracking_parameters = sl.PositionalTrackingParameters()
positional_tracking_parameters.set_gravity_as_origin = True
positional_tracking_parameters.enable_imu_fusion = True
positional_tracking_parameters.mode = sl.POSITIONAL_TRACKING_MODE.GEN_2
self.zed. enable_positional_tracking(positional_tracking_parameters)
Then, every frame i rotate with
pose = sensors_data.get_imu_data().get_pose()
rotation = pose.get_rotation_matrix()
rotation_matrix = rotation.r
rotated_points = np.dot(xyz.reshape(-1, 3), rotation_matrix.T).reshape(xyz.shape)
However, I constantly see high vibration alerts on the accelerometer and so on, due to the scooter bouncing on the pavement, and I think this is causing my point cloud to not get straightened properly, so I get false slopes due to the cloud being incorrectly straightened. I also see that the position_track_state sometimes gets lost.
Am I rotating the cloud wrong or is it because of these high vibrations that I am not able to get my slopes right?