其他分享
首页 > 其他分享> > RB5环境初始化步骤

RB5环境初始化步骤

作者:互联网

1. 基本信息

Ubuntu 18.04.5.LTS

账号:root

密码:oelinux123

开机方式:长按power键大概6,7秒左右,电源插口旁的绿灯会亮

2. 连接Wi-Fi

查看无线网卡设备名称(默认是 wlan0

 ifconfig

确认无线网卡是开启状态,输入以下命令会显示出当前可搜索到的Wi-Fi列表,证明无线网卡正常

 iw dev wlan0 scan

编辑Wi-Fi配置文件wpa_supplicant.confhttps://thundercomm.s3.ap-northeast-1.amazonaws.com/shop/doc/RB5/wpa_supplicant.conf

 cd /data/misc/wifi/
 vim wpa_supplicant.conf

更改ssid(Wi-Fi名称)和key(Wi-Fi密码),保存

 # Only WPA-PSK is used. Any valid cipher combination is accepted.
 ctrl_interface=/var/run/wpa_supplicant
 update_config=1
 ​
 network={
 #Open
 #        ssid="example open network"
 #        key_mgmt=NONE
 #WPA-PSK
     ssid="MaRS_office"
     #proto=WPA
     key_mgmt=WPA-PSK
     pairwise=TKIP CCMP
     group=TKIP CCMP
     psk="mars6666"
 #WEP
 #   ssid="example wep network"
 #   key_mgmt=NONE
 #   wep_key0="abcde"
 #   wep_key1=0102030405
 #   wep_tx_keyidx=0
 }
 wowlan_triggers=magic_pkt

重启RB5,如果配置文件生效后此时应该已经连接wifi

 reboot

3. 安装Ubuntu Desktop

3.1 固件版本更新

以下刷固件步骤不需要,跳过

{

自带的Ubuntu18.04只有命令行,需要自行安装桌面版,指导文件见附件

首先要刷特定固件,固件版本:

 FlatBuild_TurboX-RB5_xx.xx_LU1.0.R.perf.Post-CS2.r003004

但是附带的User Manual里并没有该版本,改用:

 FlatBuild_TurboX-RB5_xx.xx_LU1.0.l.perf.Post-CS2.r003004

此处需要用个人PC进行adb固件安装

Step.1 ADB环境配置

1、在个人的PC上,安装ADB TOOLS

 sudo apt-get install android-tools-adb
 sudo apt-get install android-tools-fastboot

之后,进行USB driver安装与设定

cd /etc/udev/rules.d/
sudo touch 99-android.rules
sudo chmod 777 /etc/udev/rules.d/99-android.rules
vim 99-android.rules

输入:

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0777", GROUP="adm"
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0777", GROUP="adm"

保存

2、重启udev service

sudo chmod a+r /etc/udev/rules.d/99-android.rules
sudo service udev restart

3、用usb连接电脑与RB5,上电开机,等待一段时间后电脑端输入

adb devices

显示出设备,证明adb连接成功;

Step.2 固件安装

1、下载固件

https://thundercomm.s3.ap-northeast-1.amazonaws.com/shop/doc/1590131656070623/20210701/FlatBuild_TurboX-RB5_xx.xx_LU1.0.l.perf.Post-CS2.r003004.zip

2、安装固件,首先下载脚本

https://thundercomm.s3.ap-northeast-1.amazonaws.com/shop/doc/common/turbox_flash_flat.sh

3、将脚本文件放入解压后的文件夹内(路径:<folder name of image package>),并给权限

cp turbox_flash_flat.sh <folder name of image package>
cd <folder name of image package>
chmod +x turbox_flash_flat.sh

4、 将RB5进入9008 Mode

}

以上步骤不需要!

3.2 安装Gnome

1、依次运行以下命令:

apt-get remove weston*
apt-get remove wayland*
apt-get install xorg
apt-get install gnome
apt-get install lightdm

其中,安装xorg时均选择English US,安装lightdm后选择gdm3

2、相关配置文件更改

3、 设置GUI为默认启动,运行命令:

systemctl set-default graphical.target

PS: 如果日后要取消GUI(暂未验证可行性)

systemctl set-default multi-user.target

4、重启进入GUI登陆界面,输入密码时选择GNOME,否则会一直循环输入账号密码

5、该GUI目前已知的可能出现的一些问题及解决办法:

4. 基本环境及APP配置

4.1 Terminator

deb安装即可;

http://archive.ubuntu.com/ubuntu/pool/universe/t/terminator/terminator_1.91-1_all.deb

4.2 ROS-Melodic

sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
apt-get update
apt-get install ros-melodic-desktop-full
rosdep init
rosdep update
echo "source /opt/ros/melodic/setup.bash">> ~/.bashrc
source ~/.bashrc
apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
#测试,开四个terminator分别运行
roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
rviz

4.3 PCL和Eigen库

4.3.1 安装PCL

apt-get install libpcl-dev

测试PCL库是否成功,创建下面两个文件

pcl_test.cpp

//pcl_test.cpp
#include <iostream>
#include <pcl/common/common_headers.h>
#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/console/parse.h>
 
 
int main(int argc, char **argv) {
    std::cout << "Test PCL !!!" << std::endl;
    
    pcl::PointCloud<pcl::PointXYZRGB>::Ptr point_cloud_ptr (new pcl::PointCloud<pcl::PointXYZRGB>);
    uint8_t r(255), g(15), b(15);
    for (float z(-1.0); z <= 1.0; z += 0.05)
    {
      for (float angle(0.0); angle <= 360.0; angle += 5.0)
      {
	pcl::PointXYZRGB point;
	point.x = 0.5 * cosf (pcl::deg2rad(angle));
	point.y = sinf (pcl::deg2rad(angle));
	point.z = z;
	uint32_t rgb = (static_cast<uint32_t>(r) << 16 |
		static_cast<uint32_t>(g) << 8 | static_cast<uint32_t>(b));
	point.rgb = *reinterpret_cast<float*>(&rgb);
	point_cloud_ptr->points.push_back (point);
      }
      if (z < 0.0)
      {
	r -= 12;
	g += 12;
      }
      else
      {
	g -= 12;
	b += 12;
      }
    }
    point_cloud_ptr->width = (int) point_cloud_ptr->points.size ();
    point_cloud_ptr->height = 1;
    
    pcl::visualization::CloudViewer viewer ("test");
    viewer.showCloud(point_cloud_ptr);
    while (!viewer.wasStopped()){ };
    return 0;
}

MakeLists.txt

# CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(pcl_test)
 
find_package(PCL 1.7 REQUIRED)
 
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
 
# 问题3.2(can not find libvtkproj4.so)的解决方案
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")
 
add_executable(pcl_test pcl_test.cpp)
 
target_link_libraries (pcl_test ${PCL_LIBRARIES})
 
install(TARGETS pcl_test RUNTIME DESTINATION bin)

将以上两个文件放在一个文件夹下,运行

cmake .
make
./pcl_test

出现样例点云

4.3.2 安装eigen

sudo apt-get install libeigen3-dev

4.4 LIVOX_SDK

git clone https://github.com/Livox-SDK/Livox-SDK.git
cd Livox-SDK
cd build && cmake ..
make
sudo make install

4.5 LIVOX_ROS_Driver

git clone https://github.com/Livox-SDK/livox_ros_driver.git ws_livox/src
# 需更改为修改过的livox_ros_driver包,替换src下的文件
cd ws_livox
catkin_make
echo "source ~/ws_livox/devel/setup.bash" >> ~/.bashrc
source devel/setup.bash

4.6 FAST-LIO

cd ~/ws_livox/src
git clone https://github.com/hku-mars/FAST_LIO.git
cd FAST_LIO
git submodule update --init # 这步如果报错需要配置一下git ssh
cd ../..
catkin_make
source devel/setup.bash

5. 连接LiDAR与相机

5.1 静态IP更改

将avia以太网口插入rb5网口,查看ifconfig ,默认以太网口名为eth0,更改ip地址

ifconfig # 查看网口编号
ifconfig eth0 192.168.1.1 netmask 255.255.255.0
ifconfig # 确认更改成功

5.2 avia测试

运行livox_ros_driver,成功运行会出现绿色提示

roslaunch livox_ros_driver livox_lidar_msg.launch

查看rostopic,会显示

livox_lidar
livox_imu

运行FAST_LIO

roslaunch fast_lio mapping_avia.launch
#如若不启动RVIZ:
roslaunch fast_lio mapping_avia.launch rviz:=0

5.3 Camera驱动安装

先去官网安装SDK,机器视觉工业相机客户端MVS V2.1.0(Linux)

海康机器人-机器视觉-下载中心

下载完成后解压.zip,安装其中aarch64的tar.gz

tar -zxvf XXXXXX.tar.gz
#进入解压后的带有install文档的文件夹内
chmod +x setup.bash
./setup.bash

安装完成后会显示Install Completed,可进入/opt/MVS/bin中打开MVS,GUI界面显示正常且连接相机后可读图

之后编译mvs_ros_driver, https://github.com/xuankuzcr/Handheld_ws/tree/main/src/mvs_ros_pkg ,讲.pkg放入src中并编译,记得source,其中:

# 注意检查CMakeLists里调用lib的路径是/opt/MVS/lib/aarch64 #

launch文件:
mvs_camera_trigger.launch:带同步信号
mvs_camera.launch:不带同步信号

配置文件:
left_camera_trigger.yaml:带同步信号
left_camera.yaml:不带配置文件

编译成功后,运行mvs_camera.launch

roslaunch mvs_ros_pkg mvs_camera.launch

# 如若提示没有设定Exposure Time,在yaml里添加:
# ExposureTime: 10000

# 如若提示No Data,是rVIZ的原因,重新拔插相机可解,如若还不行,运行命令:
# rqt_image_view
# 可正常读图即可

5.4 数据采集

# 连接相机及lidar,记得修改lidar静态IP地址;
# 两个终端分别运行:
roslaunch livox_ros_driver livox_lidar_msg.launch
roslaunch mvs_ros_pkg mvs_camera_trigger.launch 

# rostopic list 查-看topic,确认lidar和相机正常
# record相机原图直接写于存在超出buffer问题,需写入压缩的图片:
rosbag record /livox/imu /livox/lidar /left_camera/image/compressed

# 查看bag信息
rosbag info XXXX.bag

# bag播放
rosbag play XXXX.bag
# 使用rqt查看时间戳信息
rqt_bag XXXX.bag

标签:初始化,get,livox,RB5,apt,install,步骤,ros,安装
来源: https://blog.csdn.net/weixin_42977048/article/details/122443675