Following the previous two articles, we continue to work on navigation and obstacle avoidance for ground unmanned vehicles based on the RK3588 processor.
Implementation of Fast-LIO Robot SLAM Indoor Positioning Algorithm with RK3588, ROS2 Humble, EasyMQoS, and MID360
Visual Power DIY Machines, WeChat Official Account: Visual Power Robot – Implementation of Fast-LIO Robot SLAM Indoor Positioning Algorithm with RK3588, ROS2 Humble, EasyMQoS, and MID360
Implementation of Fast-LIO2 Robot SLAM Outdoor Positioning Algorithm and Important Data with RK3588, ROS2 Humble, EasyMQoS, and MID360
The previous two articles mentioned that the Fast-LIO2 SLAM mapping has been successfully implemented, and we can obtain the /odometry topic (nav_msgs::msg::Odometry) and cloud_registered (sensor_msgs::msg::PointCloud2)Using octomap_server, we implemented the transformation of a 2D grid map,
but the effectiveness has not been fully tested. Further modifications are needed. Since we previously used Ego-Planer, we decided to implement Ego-Planer on ROS2 Humble.Some modifications were referenced from articles by Shi Xiaohan and other experts.The content of this article is divided into:1. Ego-Planer Simulation Testing – Directly Observing the Results2. Writing advance.launch.py Script to Start Command Subscription for Fast-LIO2Key configurations:
def generate_launch_description(): drone_id_ = "0" odometry_topic = "/Odometry" cloud_topic ="/cloud_registered" remappings=[ ('odom_world',odometry_topic), #('planning/bspline','planning/bspline'), #('planning/data_display',LaunchConfiguration('planning/data_display')), #('planning/broadcast_bspline_from_planner','/broadcast_bspline'), #('planning/broadcast_bspline_to_planner', '/broadcast_bspline'), ('grid_map/odom', odometry_topic), ('grid_map/cloud',cloud_topic), xxx ]
3. Testing4. Pure Pursuit NavigationFind in traj_server.cpp
//g North China Dog King Schemevoid cmdCallback() {}
Internally add
//puresuit by lide float rad= atan2(pos_tart[1]-pos_now[1], pos_tart[0]-pos_now[0]); float alpha = rad - _gYaw; printf("************************************************alpha:%.3f \n",alpha); if (alpha < -M_PI) alpha = alpha + 2 * M_PI ; else if(alpha > M_PI) alpha = alpha - 2 * M_PI; printf("heading:%.1f,target:%.1f,alpha:%f \n",_gYaw*180/M_PI,rad*180/M_PI,alpha*180/M_PI); float v =0.1; float w = P * 2*v*sin(alpha)/sqrt(dis); if(fabs(w)>0.1 && w>0) w =0.5; else if(fabs(w)>0.1 && w<0) w =-0.5;
The theoretical basis comes from “Programming Practice for Wheeled Autonomous Mobile Robots”ConclusionWe welcome friends to purchase. We also welcome interested parties to invest or collaborate; please contact the author through the backend. More solutions and technical content will be released in the future.