In terraslam.py, in addition to setting the lat/lon/alt/pose in the Redis STREAM, we also need to set the 'slam_registering' key in the drone's HASH table.
if slam_status == "success" and self.slam_client.latest_pose:
# Get GPS coordinates
lat, lon, alt = self.slam_client.latest_pose
logger.info(f"GPS coordinates: {lat}, {lon}, {alt}")
# Store in Redis
self.r.xadd(
"slam",
{
"pose_x": 0.0,
"pose_y": 0.0,
"pose_z": 0.0,
"lat": str(lat),
"lon": str(lon),
"alt": str(alt)
}
)
In terraslam.py, in addition to setting the lat/lon/alt/pose in the Redis STREAM, we also need to set the 'slam_registering' key in the drone's HASH table.
if slam_status == "success" and self.slam_client.latest_pose:
# Get GPS coordinates
lat, lon, alt = self.slam_client.latest_pose