1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #include "task_communication.h"
- // 定义测试函数
- void test_isPointInPolygon() {
- // 定义多边形的经纬度坐标集合
- double polygonLat[] = {34.34934, 34.25916, 34.36221, 34.21619};
- double polygonLng[] = {108.84569, 108.80257, 109.03829, 109.05611};
- // 测试点在多边形内部的情况
- double point1Lat = 34.33312;
- double point1Lng = 108.8531;
- bool result1 = isPointInPolygon(point1Lat, point1Lng, polygonLat, polygonLng);
- printf("Test case 1: Point (%f, %f) is%s inside the polygon.\n", point1Lat, point1Lng, result1 ? "" : " not");
- }
- /* USER CODE BEGIN Header_Task_communication */
- /**
- * @brief Function implementing the communication thread.
- * @param argument: Not used
- * @retval None
- */
- /* USER CODE END Header_Task_communication */
- void task_communication_content(void)
- {
- // unsigned long times = 0;
-
- LED0_TOGGLE(); // 灯翻转
- // EC800_FTP_OTA_Upgrade(); // OTA升级
- // test_isPointInPolygon(); // 电子围栏
- // rs485_poll_sendReceive(); // 与车进行通信
- // times = getRunTimeCounterValue();
- // printf("test_isPointInPolygon:%ld\r\n", times);
- osDelay(1000);
- }
|