Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shirleytyf committed Dec 3, 2023
1 parent e60657c commit 52a1b99
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions ros_ws/src/crazyswarm/scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 新增文件说明

新修改example_cmd_pos.py实现散点跟踪,本次实验采用7架crazyflies,并依据dronex.csv文件中的散点运行。

新添加distance_cal.m文件分析生成的轨迹速度与位置信息,其中采样频率设置为0.05s,如有不同,可更改文件。
14 changes: 8 additions & 6 deletions ros_ws/src/crazyswarm/scripts/distance_cal.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,20 @@
% 绘制位置图
subplot(2, 1, 1);
plot(time, position, 'LineWidth', 2); % 增加线条宽度
xlabel('Time [s]', 'FontWeight', 'bold', 'FontSize', 12);
ylabel('Position [m]', 'FontWeight', 'bold', 'FontSize', 12);
xlabel('Time [s]', 'FontWeight', 'bold', 'FontSize', 14);
ylabel('Position [m]', 'FontWeight', 'bold', 'FontSize', 14examssx);
title(sprintf('无人机 %d 的位置', i), 'FontWeight', 'bold', 'FontSize', 14);
legend('X', 'Y', 'Z', 'FontWeight', 'bold', 'FontSize', 10);
legend('V_x', 'V_y', 'V_z', 'FontWeight', 'bold', 'FontSize', 14, 'Orientation', 'horizontal');


% 绘制速度图
subplot(2, 1, 2);
plot(time, velocity, 'LineWidth', 2); % 增加线条宽度
xlabel('Time [s]', 'FontWeight', 'bold', 'FontSize', 12);
ylabel('Velocity [m/s]', 'FontWeight', 'bold', 'FontSize', 12);
xlabel('Time [s]', 'FontWeight', 'bold', 'FontSize', 14);
ylabel('Velocity [m/s]', 'FontWeight', 'bold', 'FontSize', 14);
title(sprintf('无人机 %d 的速度', i), 'FontWeight', 'bold', 'FontSize', 14);
legend('V_x', 'V_y', 'V_z', 'FontWeight', 'bold', 'FontSize', 10);
legend('V_x', 'V_y', 'V_z', 'FontWeight', 'bold', 'FontSize', 14, 'Orientation', 'horizontal');


% 保存图形
saveas(gcf, sprintf('drone_%d.png', i));
Expand Down
Binary file added ros_ws/src/crazyswarm/scripts/drone_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ros_ws/src/crazyswarm/scripts/drone_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ros_ws/src/crazyswarm/scripts/drone_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ros_ws/src/crazyswarm/scripts/drone_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ros_ws/src/crazyswarm/scripts/drone_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ros_ws/src/crazyswarm/scripts/drone_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ros_ws/src/crazyswarm/scripts/drone_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 52a1b99

Please sign in to comment.