当前位置:网站首页>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 statement tuning
- Timing role in the project
- Customize the shortcut options in El date picker, and dynamically set the disabled date
- Golang implements MD5, sha256 and bcrypt encryption
- HQL find the maximum value in a range
- Baserecyclerviewadapterhelper realizes pull-down refresh and pull-up loading
- Recovering data with MySQL binlog
- MySQL —— 16、索引的数据结构
- 将新增和编辑的数据同步更新到列表
- Van uploader upload picture implementation process, using native input to upload pictures
猜你喜欢
1130 - host XXX is not allowed to connect to this MySQL server error in Navicat remote connection database
No idle servers? Import OVF image to quickly experience smartx super fusion community version
leetcode:437. 路径总和 III【dfs 选还是不选?】
Image attribute of input: type attribute of fashion cloud learning -h5
PC starts multiple wechat at one time
Record the problems encountered in using v-print
世界读书日:我想推荐这几本书
Teach you to quickly develop a werewolf killing wechat applet (with source code)
There is no need to crack the markdown editing tool typora
Sort out several uses of network IP agent
随机推荐
[vulnhub range] - DC2
Jiachen chapter Genesis "inner universe" joint Edition
Start mqbroker CMD failure resolution
melt reshape decast 长数据短数据 长短转化 数据清洗 行列转化
Jupiter notebook installation
CVPR 2022 & ntire 2022 | the first transformer for hyperspectral image reconstruction
ZigBee CC2530 minimum system and register configuration (1)
Record Alibaba cloud server mining program processing
Go iris framework implements multi service Demo: start (listen to port 8084) service 2 through the interface in service 1 (listen to port 8083)
Common problems of unity (1)
Recovering data with MySQL binlog
31. Next arrangement
98. Error s.e.errormvcautoconfiguration $staticview reported by freemaker framework: cannot render error page for request
风尚云网学习-input属性总结
mysql8安装
如何实现点击一下物体播放一次动画
leetcode:437. Path sum III [DFS selected or not selected?]
Aviation core technology sharing | overview of safety characteristics of acm32 MCU
SSM framework series - annotation development day2-2
Connect orcale