# openeuler 移植navigation **Repository Path**: gc0094/ros_openeuler_navigation ## Basic Information - **Project Name**: openeuler 移植navigation - **Description**: No description available - **Primary Language**: C++ - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 6 - **Created**: 2021-07-20 - **Last Updated**: 2021-07-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # openeuler 移植navigation ## 1. 环境要求 1) 操作系统版本:openEuler 20.03 LTS 2) 内核版本:4.19.90-2003.4.0.0036 3) 板卡(树莓派、RK3399)已经安装了 ROS Melodic,假设ROS安装在/root/devel_isolated下(如果安装在其他目录,需要修改下面的相应地方) 4) 板卡联网,假设板卡ip是192.168.10.106(需要把下面所有这个ip的地方替换成板卡的实际ip) 5) 电脑主机安装了ROS,假设电脑主机ip是192.168.10.105(需要把下面所有这个ip的地方替换成电脑主机的实际ip) 6) 需要oe-repo和fed-repo两个repo来回切换,参见[Raspberrypi4+openEuler移植ROS Melodic](https://gitee.com/huijundi/ros_openeuler_Melodic_RB) ## 2. navigation编译 #### 2.1 设置ros环境变量 ```bash $ vim ~/.bashrc ``` 内容设置为 ``` source /root/devel_isolated/setup.bash LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64 export ROS_MASTER_URI=http://192.168.10.106:11311 export ROS_HOSTNAME=192.168.10.106 ``` ```bash $ source ~/.bashrc ``` #### 2.2 workspace准备、源码下载 ```bash $ mkdir -p /root/ws/src $ cd /root/ws/src $ catkin_init_workspace $ git clone https://github.com/ros-planning/navigation.git $ git clone https://github.com/ros-planning/navigation_msgs.git $ git clone -b melodic-devel https://github.com/ros/geometry2.git ``` 注释:geometry2一定要下载melodic的版本,不然编译不过去 #### 2.3 安装依赖 1) 设置成oe-repo,安装如下包 ```bash dnf install bullet-devel SDL-devel ``` 2) 设置成fed-repo,安装如下包 ```bash dnf install SDL_image* ``` #### 2.4 编译 ```bash $ cd /root/ws/src $ catkin_make ``` #### 2.3 添加navigation的环境变量 ```bash $ vim ~/.bashrc ``` 内容设置为 ``` source /root/devel_isolated/setup.bash source /root/ws/devel/setup.bash LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64 export ROS_MASTER_URI=http://192.168.10.106:11311 export ROS_HOSTNAME=192.168.10.106 ``` ```bash $ source ~/.bashrc ``` ## 3. navigation运行测试 #### 3.1 安装依赖 ```bash $ pip install serial ``` #### 3.2 安装机器人仿真包 ```bash $ cd /root/ws/src $ git clone https://github.com/pirobot/rbx1.git $ git clone https://github.com/vanadiumlabs/arbotix_ros.git $ cd .. $ catkin_make ``` #### 3.3 导航测试 1) 开启3个终端,如下图所示 ![](files/11.png) 从左到右,左边2个终端在板卡端,分别运行 ```bash $ roslaunch rbx1_bringup fake_turtlebot.launch $ roslaunch rbx1_nav fake_amcl.launch ``` 右边终端在电脑主机端(需要安装机器人仿真包rbx1,或者从板卡拷贝一个nav_test.rviz),需要配置如下环境变量,然后准备运行rviz ```bash $ export ROS_MASTER_URI=http://192.168.10.106:11311 $ export ROS_IP=192.168.10.105 $ rosrun rviz rviz -d `rospack find rbx1_nav`/nav_test.rviz ``` 2) 3个终端运行结果 ![](files/22.png) ![](files/33.png) 3) 导航测试 在rviz窗口里,点击工具栏的2D Nav Goal,设置机器人目标,然后就可以看到导航过程,如下图所示 ![](files/44.png)