Author Image

Hi, I am Shawn

最近文章

Hero Image
使用Cartographer进行建图

ubuntu22.04安装cartograph 源码安装 在我们的项目中,需要在ubuntu22.04下源码安装cartograph.可以按照以下步骤进行. git clone git@github.com:ros2/cartographer.git git clone git@github.com:ros2/cartographer_ros.git # 安装依赖项 absl c++扩展库,参考下install_abseil.sh里使用的absl版本 git clone git@github.com:abseil/abseil-cpp.git cd abseil-cpp git checkout 215105818dfde3174fe799600bb0f3cae233d0bf cd build cmake -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DCMAKE_INSTALL_PREFIX=/usr/local/stow/absl \ .. ninja sudo ninja install cd /usr/local/stow sudo stow absl # 安装 ceres 非线性优化库 sudo apt install libceres-dev # 安装lua 脚本语言库,提供配置文件解析 sudo apt install liblua5.3-dev # 安装protobuf 数据序列化开发库 sudo apt install protobuf-compiler libprotobuf-dev # 安装地图可视化库,支持轨迹绘制以及地图可视化 sudo apt install libcairo2-dev # 安装boost C++ 库集合 sudo apt install libboost-all-dev # 安装 Eigen3 线性代数库 sudo apt install libeigen3-dev # 编译cartographer_ros colcon build --packages-up-to cartographer_ros # rviz插件我们直接使用apt安装 sudo apt install ros-humble-nav2-rviz-plugins sudo apt install ros-humble-cartographer-rviz 保存地图 使用Cartographer进行建图时,可以将建图结果保存下来,我们这里可以采用ROS2自带的保存地图工具nav2_map_server.

Hero Image
Github错误处理

github 问题处理 分离指针 HEAD detached from ff8573b 分离头指针是说Git仓库的HEAD指针没有指向任何分支,而是直接指向一个特定的commit。正常情况下,HEAD应该指向一个确定的分支,但在分离头指针状态下,HEAD指向了某个commit。 以下指令会导致处于分离头指针状态: 直接检出了某个commit 检出远程指针时并没有在本地创建对应的本地分支 在主仓库中的submodule仓库(子模块)一般都处于分离头指针状态,这是因为主仓库对应的是子仓库的某一次提交,在检出时就会检出特定的commit提交,而不是某个分支。 HEAD detached from就是报告了github处于分离头指针状态,如果我们需要将当前的修改保存到main分支,则按照下述指令进行。 # 创建临时分支,保存修改 git branch temp # 切换到主分支 git checkout main # 合并temp 分支 git merge temp # 删除 temp 分支 git branch -d temp # 将修改推送到远程 git push origin main 拉取分支 将云端指定分支拉取到本地 # 获取远程分支信息 git fetch origin # 查看远程分支有哪些分支 git branch -r # 创建指定分支 git checkout -b dev origin/dev 丢弃提交 丢弃某一次commit 在项目开发中,如果进行了一次错误提交,需要删除这次提交所对应的修改,最安全的方式是创建一次新的commit来撤销之前的commit。 # 创建一个新的commit来撤销之前的commit git revert <commit-hash> 拉取仓库错误 拉取仓库错误 ssh: Could not resolve hostname github.com: Temporary failure in name resolution fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 在wsl中拉取仓库中出现了这个错误,但是在宿主机是可以访问github的,这个问题是DNS原因导致的,可以按照如下步骤解决: