| | |
| | | uint16_t samegroup_ancid,anc_mount_dist; |
| | | uint8_t getvaluetimes = 0; |
| | | uint16_t first_dist,second_dist,delta_dist; |
| | | int16_t tag_angle[TAG_NUM_IN_SYS]; |
| | | int16_t tag_angle[TAG_NUM_IN_SYS],tag_dist[TAG_NUM_IN_SYS]; |
| | | float p_dist; |
| | | void AngleCalculate(void) |
| | | { |
| | |
| | | { |
| | | p_dist = -1; |
| | | } |
| | | tag_angle[taglist_pos] = -asin(p_dist)*57.3; |
| | | tag_dist[taglist_pos] = second_dist; |
| | | tag_angle[taglist_pos] = asin(p_dist)*57.3; |
| | | OUT485_ENABLE; |
| | | delay_us(10); |
| | | printf("è§åº¦ï¼%d,è·ç¦»å·®ï¼%d,è·ç¦»1ï¼%d,è·ç¦»2:%d......\r\n",tag_angle[taglist_pos],first_dist-second_dist,first_dist,second_dist); |
| | | delay_us(10); |
| | | OUT485_DISABLE; |
| | | } |
| | | } |
| | | extern int16_t alarm_angle; |
| | |
| | | } |
| | | motorstate =0; |
| | | |
| | | if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE1]||tagdist_list[taglist_pos]==0) |
| | | if(g_Tagdist[taglist_pos]<g_com_map[ALARM_DISTANCE1]||g_Tagdist[taglist_pos]==0) |
| | | { |
| | | motorstate =0; |
| | | }else if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE2]) |
| | | }else if(g_Tagdist[taglist_pos]<g_com_map[ALARM_DISTANCE2]) |
| | | { |
| | | if(flag_tag_distsmooth[taglist_pos]&&tag_angle[taglist_pos]>alarm_angle) |
| | | if(flag_tag_distsmooth[taglist_pos]) |
| | | {motorstate =2; |
| | | }else{ |
| | | motorstate =0; |
| | | } |
| | | }else if(tagdist_list[taglist_pos]<g_com_map[ALARM_DISTANCE3]) |
| | | }else if(g_Tagdist[taglist_pos]<g_com_map[ALARM_DISTANCE3]) |
| | | { |
| | | if(flag_tag_distsmooth[taglist_pos]&&tag_angle[taglist_pos]>alarm_angle) |
| | | if(flag_tag_distsmooth[taglist_pos]) |
| | | {motorstate =1; |
| | | }else{ |
| | | motorstate =0; |