Skip to content

Commit

Permalink
Get drone velocity in calculate_avoidance_path #16
Browse files Browse the repository at this point in the history
  • Loading branch information
RexBerry committed Oct 12, 2022
1 parent 1548642 commit fddf682
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion flight/avoidance/obstacle_avoidance.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,18 @@ async def calculate_avoidance_path(
# Convert drone position to UTM Point
drone_position: Point = Point.from_mavsdk_position(raw_drone_position)

# Get velocity of drone
raw_drone_velocity: mavsdk.telemetry.VelocityNed
async for velocity in drone.telemetry.velocity_ned():
raw_drone_velocity = velocity
break

# Convert drone position to Velocity object
# Units don't change, only the type of the object
drone_velocity: Velocity = Velocity.from_mavsdk_velocityned(raw_drone_velocity)

# TODO: Do something useful with these variables
print(obstacle_data, drone_position, avoidance_radius)
print(obstacle_data, drone_position, drone_velocity, avoidance_radius)

raise NotImplementedError

Expand Down

0 comments on commit fddf682

Please sign in to comment.