ROS1 go2 vlp16 局部避障--3 篇 - 教程

news/2025/10/28 20:39:26/文章来源:https://www.cnblogs.com/yangykaifa/p/19172689

本文介绍ROS1下 unitree + vlp16 + cartographer的 自主定位+避障+探索

本文的基础搭建:gazebo模型及各类配置文件见https://blog.csdn.net/weixin_41469272/article/details/152049194
需要完成以上的配置的基础上,才能进行本文的配置。

  • 0. 更新各类配置文件

unitree_guide/unitree_move_base/config/vlp_costmap_common_params.yaml

obstacle_range: 10         ##
raytrace_range: 15         ##
footprint: [[0.3, 0.4], [0.3, -0.4], [-0.35, -0.4], [-0.35, 0.4]]
# robot_radius: 0.3
inflation_radius: 0.3
max_obstacle_height: 5.0
min_obstacle_height: 0.0
origin_z: 0.0
# observation_sources: scan
# scan: {data_type: LaserScan, topic: /merged_laserscan, marking: true, clearing: true, expected_update_rate: 3.3}
observation_sources: scan
scan: {data_type: LaserScan, topic: /scan, marking: true, clearing: true, expected_update_rate: 10}
#observation_sources: scan
#headLaserscan: {data_type: LaserScan, topic: scan, marking: true, clearing: true, expected_update_rate: 10}

unitree_guide/unitree_move_base/config/vlp_global_costmap_params.yaml

global_costmap:global_frame: odomrobot_base_frame: baseupdate_frequency: 1.0publish_frequency: 1.0rolling_window: truewidth: 20.0height: 15.0resolution: 0.05transform_tolerance: 1.0
plugins:- {name: static_layer, type: "costmap_2d::StaticLayer"}- {name: obstacles, type: "costmap_2d::ObstacleLayer"}- {name: inflation, type: "costmap_2d::InflationLayer"}

unitree_guide/unitree_move_base/config/vlp_local_costmap_params.yaml

local_costmap:global_frame: odomrobot_base_frame: baseupdate_frequency: 5.0publish_frequency: 3.0rolling_window: truewidth: 3height: 5inflation_radius: 0.3resolution: 0.05transform_tolerance: 1.0
plugins:- {name: obstacles, type: "costmap_2d::ObstacleLayer"}- {name: inflation, type: "costmap_2d::InflationLayer"}

cartographer_ros/cartographer_ros)/configuration_files/vlp_2d.lua

include "map_builder.lua"
include "trajectory_builder.lua"
options = {map_builder = MAP_BUILDER,trajectory_builder = TRAJECTORY_BUILDER,map_frame = "map",tracking_frame = "imu_link",published_frame = "odom",odom_frame = "odom",provide_odom_frame = false,publish_frame_projected_to_2d = false,use_odometry = true,use_nav_sat = false,use_landmarks = false,num_laser_scans = 1,num_multi_echo_laser_scans = 0,num_subdivisions_per_laser_scan = 1,num_point_clouds = 0,lookup_transform_timeout_sec = 0.2,submap_publish_period_sec = 0.3,pose_publish_period_sec = 5e-3,trajectory_publish_period_sec = 30e-3,rangefinder_sampling_ratio = 1.,odometry_sampling_ratio = 1.,fixed_frame_pose_sampling_ratio = 1.,imu_sampling_ratio = 1.,landmarks_sampling_ratio = 1.,
}
pose_extrapolator = {pose_queue_duration = 0.5,imu_gravity_time_constant = 10.,odometry_translation_weight = 1.,odometry_rotation_weight = 1.,
}
MAP_BUILDER.use_trajectory_builder_2d = true
TRAJECTORY_BUILDER_2D.submaps.num_range_data = 35
TRAJECTORY_BUILDER_2D.min_range = 0.3
TRAJECTORY_BUILDER_2D.max_range = 8.
TRAJECTORY_BUILDER_2D.missing_data_ray_length = 1.
TRAJECTORY_BUILDER_2D.use_imu_data = false
TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.linear_search_window = 0.1
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.translation_delta_cost_weight = 10.
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.rotation_delta_cost_weight = 1e-1
POSE_GRAPH.optimization_problem.huber_scale = 1e2
POSE_GRAPH.optimize_every_n_nodes = 35
POSE_GRAPH.constraint_builder.min_score = 0.65
return options

unitree_guide/unitree_move_base/launch/my_carto_explore.launch

<launch><node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan"respawn="false" output="screen"><remap from="cloud_in" to="/velodyne_points"/><!--remap from="/scan" to="/headLaserScan"/--><rosparam>target_frame: velodynetransform_tolerance: 0.1min_height: 0.0max_height: 1.0angle_min: -3.14159angle_max: 3.14159angle_increment: 0.0175scan_time: 0.1range_min: 0.5range_max: 10.0use_inf: false# Concurrency level, affects number of pointclouds queued for processing and number of threads used# 0 : Detect number of cores# 1 : Single threaded# 2->inf : Parallelism levelconcurrency_level: 1</rosparam></node><!-- MoveBase --><node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen"><rosparam file="$(find unitree_move_base)/config/vlp_costmap_common_params.yaml" command="load" ns="global_costmap" /><rosparam file="$(find unitree_move_base)/config/vlp_costmap_common_params.yaml" command="load" ns="local_costmap" /><rosparam file="$(find unitree_move_base)/config/vlp_global_costmap_params.yaml" command="load" /><rosparam file="$(find unitree_move_base)/config/vlp_local_costmap_params.yaml" command="load" /><rosparam file="$(find unitree_move_base)/config/vlp_teb_local_planner_params.yaml" command="load" /><!-- (TEB) --><!--param name="base_global_planner" value="global_planner/GlobalPlanner"/--><param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS"/></node><!-- AMCL --><!-- <include file="$(find unitree_move_base)/launch/amcl.launch" /> --><param name="/use_sim_time" value="true" /><node name="cartographer_node" pkg="cartographer_ros"type="cartographer_node" args="-configuration_directory $(find cartographer_ros)/configuration_files-configuration_basename vlp_2d.lua"output="screen"><!--remap from="points2" to="/velodyne_points" /--><remap from="imu" to="/trunk_imu" /><!--remap from="/scan" to="/headLaserScan"/--></node><node name="cartographer_occupancy_grid_node" pkg="cartographer_ros"type="cartographer_occupancy_grid_node" args="-resolution 0.05" /><!--node name="rviz" pkg="rviz" type="rviz" required="true"args="-d $(find cartographer_ros)/configuration_files/demo_2d.rviz" /--><node pkg="explore_lite" type="explore" name="explore" output="screen"><param name="costmap_topic" value="/map"/><param name="robot_base_frame" value="base"/><!--param name="costmap_topic" value="/move_base/global_costmap/costmap"/--><!--param name="costmap_updates_topic" value="costmap_updates"/--><param name="costmap_updates_topic" value="map_updates"/><param name="visualize" value="true"/><param name="planner_frequency" value="0.2"/><param name="progress_timeout" value="30.0"/><param name="potential_scale" value="3.0"/><param name="gain_scale" value="1.0"/><param name="min_frontier_size" value="0.5"/><param name="frontier_search_size" value="15.0" />launch-prefix="bash -c 'sleep 1.0; $0 $@' "></node><!-- rviz --><node pkg="rviz" type="rviz" name="rviz" args="-d $(find unitree_move_base)/config/my_cart_move_base.rviz"/></launch>
  • 1. 启动gazebo仿真
roslaunch unitree_guide vlp_go2.launch
  • 2. 启动控制模块
 ./devel/lib/unitree_guide/junior_ctrl

后输入2,让狗站起来。再进行下述操作

  • 3. 启动move_base + cartographer + pc2scan
roslaunch unitree_move_base my_carto_explore.launch

在这里插入图片描述

问题

  • 待解决问题
    gazebo 加载带雷达的go2 时,狗头会被激光压歪。使得整个地图的构建也是歪的
    原因分析:由于vlp16重力导致。尚未去解
    折中办法:在启动move_base 之前,先让go2先站起来,后启动定位节点,减少

  • cartograoher的base_link找不到到source frame的映射关系,此外还有rviz 中trajecties有报错的问题
    go2 模型使用的base坐标系,暂时没管。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/949121.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

25.10.28随笔NOIP模拟赛总结

考试 开考看题,秒了 T1,感觉 T2 是简单 dp,T3 有点神秘不知道,T4 一眼有一个 \(\mathcal O(n^2)\)。于是顺序开题。T1 很快写了,T2 看了一个小时还是不会有点难崩,当时是很快想到一个 dp,设 \(f_{i,j,0/1}\) 表…

第二十八篇

今天是10月28号,上了铁道技术认知。

P8269 [USACO22OPEN] Visits S

P8269 [USACO22OPEN] Visits S 题解题目传送门 博客传送门 首先,每头牛牛都只有一个拜访对象,所以如果考虑图论建模的话,相当于每个点出度都是 1。这相当于图是个基环树森林(注意不只有一棵基环树),而且每个基环…

Luogu P13925 [POKATT 2024] 联合猫国 / The Paw-litical Game 题解 [ 蓝 ] [ 线性 DP ] [ 种类数观察 ]

联合猫国 去年模拟赛做过一道几乎一模一样的题,于是一眼秒了。 本题的一个结论:最终可合并的区间数为 \(\bm{O(n\log n)}\) 级别。 证明可以考虑构造出可合并区间数最多的序列,显然是所有数都相同时的区间数,可以取…

深入解析:【STM32项目开源】基于STM32的独居老人监护系统

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

CSP-S 41多校 9

10.28 (虽然但是下发文件NOIP?)10.28 CSP-S 前倒数第二场模拟赛,直接一道都没切出来。。。 再不放信心赛真要没信心了。 t1 dp题。 显然对于每一次行动都是一个背包dp。 变种在于背包更换,更换后容量重新计算。 所…

【25.10.28】模拟赛

T1 code #include<bits/stdc++.h> using namespace std; const int N=5e4+5,M=1e3+5; int n,m,ans=0; char s[N],t[M]; int nxt[M]; int f[N][M]; int g[M][30]; void getnxt(){nxt[1]=0;int j=0;for(int i=2;i&…

CSP-S模拟41

CSP-S模拟41 A. 数轴取物(axis) 显然可以有一个 \(O(n^3)\) 的背包 dp,设 \(dp[i][j][k]\) 表示选区间 \([i,j]\),背包容量为 \(k\) 时可获得的最大价值。每次枚举固定左端点从小到大枚举右端点,发现 \(dp[i][j]\) …

Linux双中文编码笔记

Linux双中文编码笔记/etc/locale.gen zh_CN.GB18030 GB18030zh_CN.GBK GBK 上面两行默认是被注释掉的,要打开。 /usr/sbin/dpkg-reconfigure/usr/sbin不在普通用户的PATH里,再说运行它也需要root权限。 如果dkpg-rec…

C++类和对象(1) - 详解

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

人工智能之编程基础 Python 入门:第二章 Python 的编辑器 VS Code

人工智能之编程基础 Python 入门:第二章 Python 的编辑器 VS Code人工智能之编程基础 Python 入门 第二章 Python 的编辑器 VS Code@目录人工智能之编程基础 Python 入门前言一、VS Code安装二、配置PythonVS Code 汉…

2019 福建省队集训录

退役前最后的贡献\(\scr{Day}\ 1\) T1 (sort)Source:$\bf{solution}$$\bf{code}$T2 (sort)Source:$\bf{solution}$$\bf{code}$T3 (sort)Source:$\bf{solution}$$\bf{code}$

AIX multibos bootlist

Check bash bootlist -m normal -o hdisk0 blv=hd5 pathid=0 lspv hdisk0 00cc4bc0964f315a rootvg active hdisk1 00cc4bc028d6260c altinst_root…

记录一次nginx能通但是请求一直不了的问题

今天在公司碰到这样一个问题:开发后在测试环境进行部署,部署后有个调用其他部门的接口,需要通过nginx来代理请求转发到另一个部门。运维把nginx配置完成后,本地和开发测试都正常,但是通过测试环境访问一直是不同的…

【嵌入式】PWM DAC的滤波器设计

PWM DAC PWM概念本身很简单,具体可以参考各网上资料。PWM:脉冲宽度调制(英语:Pulse-width modulation,缩写:PWM),简称脉宽调制,是用脉冲来输出模拟信号的一种技术,一般变换后脉冲的周期固定,但脉冲的工作周…

被称作遗憾之物 爬满了脊骨 又把控了痛楚 被称作无用之物 修筑了唯一的通路

test30 前两题都 0pts,nbm(? 2-A 飞船制造 (spaceship.cpp) 怎么有傻子没开 c++11 写了 rank 然后 re 惹 /fad 考虑依次枚举 \(s=i+j+k\),计算出 \(s\) 一定的方案数就能确定唯一的 \(s\),方案数计算好像只能考虑…

neovim在windwos11下snack.nvim的问题

问题复现 首先确定有 find 命令,在执行之后,会出现下面的问题: Command failed: - cmd: `find . -type f -not -path */.git/* -not -path */.*`几乎百分百。 查找原因 查阅之后得知,问题为调用了linux风格的find命…

完整教程:Java 集合 “List + Set”面试清单(含超通俗生活案例与深度理解)

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

禁用 IPython 历史记录 history.sqlite

Windows 在 %UserProfile%\.ipython\profile_default\ 文件夹中或 Linux 在 ~/.ipython/profile_default/ 目录中(默认配置文件名为profile_default),新建ipython_config.json文件,填入以下内容即可禁用 IPython 历…

Luogu P7914 [CSP-S 2021] 括号序列 题解 [ 蓝 ] [ 区间 DP ] [ 前缀和优化 ] [ 调试技巧 ]

括号序列:无聊,感觉做过类似的拼接类区间 DP 就直接秒了。 注意到这个超级括号序列定义很复杂,除了两边没有 \(\texttt{*}\) 没有啥很好的性质。于是直接考虑暴力区间 DP:定义 \(dp_{l, r}\) 表示 \(l\sim r\) 的合…