当前位置:网站首页>Complete project data of UAV apriltag dynamic tracking landing based on openmv (LabVIEW + openmv + apriltag + punctual atom four axes)
Complete project data of UAV apriltag dynamic tracking landing based on openmv (LabVIEW + openmv + apriltag + punctual atom four axes)
2022-04-23 13:00:00 【Outside Jinguan City】
Preface :
A small project done during the previous holiday , Blew up several sets of blades 233, Share it, hoping to help more people learn quickly .
Using punctual atoms ATK-MiniFly Secondary development of aircraft multi rotor Apriltag track ;
Use LABVIEW The independently designed ground station is used to send control commands and receive information ;
aircraft : STM32F4+FreeRTOS;
The remote control : STM32F1+FreeRTOS;
OPENMV: STM32H7
Users can OPENMV Replace with advanced vision opencv、yolo etc. , Other functions can be quickly redeveloped according to the existing interface design protocol .
This project is applicable to STM32( involve F1、F4、H7) as well as FreeRTOS Beginners of operating system and those who are interested in the development of navigation and control of multi rotor flight control system , Need some programming ability , The project has been completed , The following functions have been realized , Welcome to comment area .
Functional specifications :
1.labview Independently designed ground station ( After the dependency package is installed, it can run independently labview), The ground station terminal contains one button take-off 、 One button emergency stop 、 One touch landing 、 One click tracking tag Code button , And the display interface of relevant information ;
2. Use openmv Official routine Apriltag distinguish tag Tag and pose information , Frame... In the image tag label , And upload it to the four axis aircraft through the serial port ;
3. Between the remote controller and the ground station USB/ Data transmission connection , Aircraft and OPENMV Serial port connection is adopted ;
4. The remote controller can reflect relevant status information , One button take over the autonomous control state , Ensure safe flight ;
Material description :
1.ATK-MiniFly
2. OPENMV4
3. Apriltag (tag16h5)
Ground station protocol description : ( The specific flight control code can be deduced )
1. Take off with one click 、 land :0xaa 0x11 ( On the ground, take off , In the air, it lands )
2. One button emergency stop : 0xaa 0x22 ( Lock the paddle directly , Caution! )
3. One click tracking tag code :0xaa 0x33( Click... After takeoff , otherwise openmv Lack of vision )
Ground station ui Interface :

Aircraft related information :( Search and download official information by yourself )

OPENMV Guide aircraft core code :
bool opv_control_state=0;
float opv_x_data=0,opv_y_data=0; // North West celestial coordinate system front x just Left y just On z just
void opv_Communication_Task(void *param)
{
while(1)
{
if(opv_control_state==1)
{
if(SDK_tag.Tx<0)opv_y_data=-5;
else if(SDK_tag.Tx>0)opv_y_data=5;
else opv_y_data=0;
if(SDK_tag.Ty<0)opv_x_data=-5;
else if(SDK_tag.Ty>0)opv_x_data=5;
else opv_x_data=0;
}
else
{
opv_x_data=0;
opv_y_data=0;
}
ledSet(LED_BLUE_L,opv_control_state); // The left rear light of the aircraft judges opv Control state , bright (1) Allow tracking tag
vTaskDelay(200);
}
}
Aircraft position output core code :
if(getOpDataState() && commander.ctrlMode == 0x03) /* Optical flow data is available , Fixed point mode */
{
setpoint->attitude.yaw *= 0.5f; /* Fixed point mode slows down yaw Adjust the */
/* Adjusting position Speed mode */
if(fabsf(setpoint->attitude.roll) > 1.5f || fabsf(setpoint->attitude.pitch) > 1.5f || opv_control_state == 1)
{
adjustPosXYTime = 0;
isAdjustingPosXY = true;
setpoint->mode.x = modeVelocity;
setpoint->mode.y = modeVelocity;
setpoint->velocity.x = setpoint->attitude.pitch * 4.0f + opv_x_data;// The inclination is greater than 1.5° When the
setpoint->velocity.y = setpoint->attitude.roll * 4.0f + opv_y_data;
}
else if(isAdjustingPosXY == true)
{
if(adjustPosXYTime++ > 100)
{
adjustPosXYTime = 0;
isAdjustingPosXY = false;
}
setpoint->mode.x = modeAbs;
setpoint->mode.y = modeAbs;
setpoint->position.x = state->position.x + errorPosX; // Adjust the new position
setpoint->position.y = state->position.y + errorPosY; // Adjust the new position
}
else if(isAdjustingPosXY == false) /* Displacement error */
{
errorPosX = setpoint->position.x - state->position.x ;// Shake the lever and execute here
errorPosY = setpoint->position.y - state->position.y ;
errorPosX = constrainf(errorPosX, -30.0f, 30.0f); /* Error limiting Company cm*/
errorPosY = constrainf(errorPosY, -30.0f, 30.0f); /* Error limiting Company cm*/
}
}
else /* Manual mode */
{
setpoint->mode.x = modeDisable;
setpoint->mode.y = modeDisable;
}
Take off with one click 、 land 、 Emergency stop 、 Trace and other instruction core code :
if(drone_control_state==0x11)//pc Take off with one touch 、 One touch landing
{
if( getRCLock()==false && getIsMFCanFly()==true &&
(configParam.flight.ctrl == ALTHOLD_MODE || configParam.flight.ctrl == THREEHOLD_MODE)
)
{
sendRmotorCmd(CMD_FLIGHT_LAND, NULL);
}
drone_control_state=0;
}
else if(drone_control_state==0x22)//pc End one button emergency stop
{
sendRmotorCmd(CMD_EMER_STOP, NULL);
drone_control_state=0;
}
else if(drone_control_state==0x33)//pc End one key tracking tag code
{
sendRmotorCmd(CMD_TAG_TRACK, NULL);
LED_RED = !LED_RED;
drone_control_state=0;
}
else drone_control_state=0;
Some aircraft information is sent to LABVIEW Core code :
/***************************************************************************************************************************/
printf("A"); //0
/***************************************************************************************************************************/
drone_pit=limit(plane_pitch*10,-999,999);// take flyControl.pitch*100 Replace with plane_pitch*10 You can upload the aircraft attitude information
if(drone_pit>0)printf("+");
else
{
printf("-"); //1
drone_pit=-drone_pit;
}
send_bai=drone_pit/100;
send_shi=drone_pit%100/10;
send_ge=drone_pit%100%10;
printf("%d",send_bai); //2
printf("%d",send_shi); //3
printf("%d",send_ge); //4
/***************************************************************************************************************************/
drone_rol=limit(plane_roll*10,-999,999);
if(drone_rol>0)printf("+");
else
{
printf("-"); //5
drone_rol=-drone_rol;
}
send_bai=drone_rol/100;
send_shi=drone_rol%100/10;
send_ge=drone_rol%100%10;
printf("%d",send_bai); //6
printf("%d",send_shi); //7
printf("%d",send_ge); //8
/***************************************************************************************************************************/
drone_yaw=limit(plane_yaw*10,-1800,1800);
if(drone_yaw>0)printf("+");
else
{
printf("-"); //9
drone_yaw=-drone_yaw;
}
send_qian=drone_yaw/1000;
send_bai=drone_yaw%1000/100;
send_shi=drone_yaw%1000%100/10;
send_ge=drone_yaw%1000%100%10;
printf("%d",send_qian); //10
printf("%d",send_bai); //11
printf("%d",send_shi); //12
printf("%d",send_ge); //13
/***************************************************************************************************************************/
See the comments section for links to all the information , If you have any questions, please leave a message or discuss in the comment area .
author : Outside Jinguan City
Time :2021.11
I wish good !
版权声明
本文为[Outside Jinguan City]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230613382690.html
边栏推荐
- HQL find the maximum value in a range
- Kubernets Getting started tutoriel
- At instruction of nbiot
- Go language mapping operation
- 进程虚拟地址空间区域划分
- SSM framework series - data source configuration day2-1
- Install nngraph
- Pytorch: a pit about the implementation of gradreverselayer
- Mysql8 installation
- Free and open source agricultural Internet of things cloud platform (version: 3.0.1)
猜你喜欢

Unlock openharmony technology day! The annual event is about to open!

melt reshape decast 长数据短数据 长短转化 数据清洗 行列转化

有趣的IDEA插件推荐,给你的开发工作增添色彩

Process virtual address space partition

SSM框架系列——数据源配置day2-1

Importerror after tensorflow installation: DLL load failed: the specified module cannot be found, and the domestic installation is slow

产品开发都应该知道的8个网站,增强工作体验

云原生KubeSphere部署Redis

PC starts multiple wechat at one time

Record a website for querying compatibility, string Replaceall() compatibility error
随机推荐
JDBC connection pool
The El table horizontal scroll bar is fixed at the bottom of the visual window
HQL find the maximum value in a range
There is no need to crack the markdown editing tool typora
Buuctf Web [gxyctf2019] no dolls
SSL certificate refund instructions
1130 - host XXX is not allowed to connect to this MySQL server error in Navicat remote connection database
将新增和编辑的数据同步更新到列表
Go language array operation
Golang realizes regular matching: the password contains at least one digit, letter and special character, and the length is 8-16
decast id.var measure.var数据拆分与合并
CVPR 2022&NTIRE 2022|首个用于高光谱图像重建的 Transformer
Start mqbroker CMD failure resolution
Record Alibaba cloud server mining program processing
21 days learning mongodb notes
[vulnhub range] - DC2
Ad20 supplementary note 3 - shortcut key + continuous update
8 websites that should be known for product development to enhance work experience
No idle servers? Import OVF image to quickly experience smartx super fusion community version
22. 括号生成