source: qcustomplot
- initial_gragh---
Initialize_Plot
- live plotting(sinx)--- ``
- define the shape of gragh from input button
Plotting
button clicked---Printing_Timer
start---Realtime_Plot
start
clear all
button clicked---Printing_Timer
stop---MapPlot
clear
-
define the obstacles generator step 1: Define two obs modes, a. Custom input obstacles; b. Randomly generated a. custom input obstacles ui flow: "ask obs nums:xx" --> define a empty table([nums,3])
-
design real-time APF
- a. custom input obstacles ui flow:
"ask obs nums:xx" --> push button
Obs_Input
, define a empty table([nums,3])--> write down the obs info --> push buttonObs_Info_get
, store the data in the vectorobs_info
, plot the Ellipse inMapPlot
- from 20240515, the project Project code standards tend to be Oxygen format specifications. However, Oxygen adapted for Qt Creator has not been updated for many years. So I learned from online tutorials and customized two formats
header version notes:
* @version 1.2
* @author Fennmai
* @date 16/05/2024
* @brief
* 1.
* 2.
* 3.
cpp function notes:
/*************************************************
**Function:
**Description:
**Input:
**Output:
**Return:
**Others:
*************************************************/
- 想到了一个问题,我的UI是用QT Designer 进行编辑的,但是时间久了,就容易忘记button的命名和对应在代码里面的触发功能。所以应该开一个新的文档,对当前的UI功能名字,对应当前的函数等等进行解释。 或者,使用Oxygen来进行自动化文档管理
- 上述问题
- on_Obs_RndGen_clicked()经过检查和思考后,决定需要重构
solution: I forgot to define it in the CMakeLists.txt, adding it now.
set(PROJECT_SOURCES src/qt/pathplanning_platform.ui)
- 20240508
when I setting the
clear all
button, the original objective:1. stop the Printing_Timer;2. clear the graph; Objective1 is achieved,but Objective2 can not achieve, as shown below
solution:
before:
void PathPlanning_Platform::on_Plotting_Clear_clicked()
{
Printing_Timer->stop();
ui->output_txt->setText("stopping plotting");
MapPlot->graph(0)->data()->clear();
}
after:
void PathPlanning_Platform::on_Plotting_Clear_clicked()
{
Printing_Timer->stop();
ui->output_txt->setText("stopping plotting");
MapPlot->graph(0)->data()->clear(); // 清除数据
MapPlot->replot(); // 重要:调用 replot 来更新图表显示
}
- 20240508 另一个问题,当我按下了Plotting,开始实时画图,然后按下Plotting_Clear,可以正常停下timer,清除graph(0)内容。但是,当我再按下Plotting,它是从上一次停下的点开始继续画,这不是我想要的。我想要它每次Plotting,都是重头开始.
solution:
rt_location.x = 0;
错误:
放在Realtime_Plot()里面。不行,因为Realtime_Plot是每次timer都会调用触发的,
它会一直触发x=0,导致图只会画第一个点
正确:放入`on_Plotting_clicked`因为目标就是按钮被按下,重新开始,
它在这里只会执行一次
- 20240508 每个版本规范迭代,如何更好的记录和显示每个版本的功能和结果?
solution:
- 提炼记录每个版本的开发内容。
- 录屏--->转换成gif--->保存到markdown中
e.g. Now:sinx , x (0.6)
terminal:
ffmpeg -i "xxxname.webm" -filter_complex "[0:v] fps=15,scale=800:-1:flags=lanczos,split [a][b];[a] palettegen [p];[b][p] paletteuse" output.gif
If the image quality is too low, change the scale. e.g. scale=1024...