필터 지우기
필터 지우기

UAV Toolbox - Reference Frame Definition

조회 수: 5 (최근 30일)
Eryn Jaramillo
Eryn Jaramillo 2024년 5월 20일
댓글: Jianxin Sun 2024년 5월 23일
I am able to attain data using the UAV Toolbox functions waypointTrajectory and lookupPose, but I don't understand the reference frame in which the data is being provided. Take the UAV Toolbox waypointTrajectory function example titled "Create Trajectory using Waypoint and Ground Speed" linked here. The default reference frame for the waypointTrajectory function is said to be "NED", but in either reference frame case ("NED" or "ENU") the position values output are both positive. I assumed that when climbing in altitude the position value output for the "NED" frame would be negative. My assumption, at this point, is the "NED" frame is set at latitude, longitude, and height of 0 and the information being output is given with respect to the body frame. Does this sound correct or does anyone have a better explanation to the frame of reference in which the data is being provided?

채택된 답변

Paul
Paul 2024년 5월 21일
편집: Paul 2024년 5월 21일
In reference to the example on the linked page, I assume the waypoints are specified in the waypoint trajectory reference frame. So the waypoint at [10 50 10] specifies a waypoint at 10 m down if in NED and 10 m up in ENU. In either case, the trajectory starts at 0 and moves to positive 10. When using plot3, the default direction of the z-axis is to point up on the screen, so even a motion from 0 to 10 m Down looks like the trajectory is going up on the screen (and likewise the East axis looks like it's pointing west).
waypoints = [0 0 0;
10 50 10];
speeds = [0 10];
jerkLimit = 0.5;
trajectory = waypointTrajectory(waypoints,GroundSpeed=speeds,JerkLimit=jerkLimit,ReferenceFrame="NED");
t0 = trajectory.TimeOfArrival(1);
tf = trajectory.TimeOfArrival(end);
sampleTimes = linspace(t0,tf,100);
[position,~,velocity,acceleration,~] = lookupPose(trajectory,sampleTimes);
figure()
plot3(position(:,1),position(:,2),position(:,3))
xlabel("N (m)")
ylabel("E (m)")
zlabel("D (m)")
title("Trajectory")
It's probably possible to muck around with the axis properties to make the axes look closer to physical reality. Alternatively, plot in ENU even when the data in NED.
  댓글 수: 1
Jianxin Sun
Jianxin Sun 2024년 5월 23일
You can use plotTransforms function with InertialZDirection set to Down to visualize the trajectory along with UAV orientation. When you use NED frame, the waypoints are also in NED frame. But when plotting it, you often need to apply extra transforms to visualize the vehicle properly. In the example below, the plot frame is in North-West-Up, a 180 degree roll relative to the NED frame used by waypoint trajectory. You will observe that the vehicle frame (shown as red-green-blue axes) has its forward direction as body x, and downward direction as body z.
waypoints = [0 0 0;
10 50 10];
speeds = [0 10];
jerkLimit = 0.5;
trajectory = waypointTrajectory(waypoints,GroundSpeed=speeds,JerkLimit=jerkLimit,ReferenceFrame="NED");
t0 = trajectory.TimeOfArrival(1);
tf = trajectory.TimeOfArrival(end);
sampleTimes = linspace(t0,tf,20);
[position,orientation,velocity,acceleration,~] = lookupPose(trajectory,sampleTimes);
figure()
plotTransforms(position, orientation, InertialZDirection="Down")
xlabel("N (m)")
ylabel("W (m)")
zlabel("U (m)")
title("Trajectory")
axis equal

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scenario Simulation에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by