Jetson TX2 安装应用镭神激光模块(基于ROS)

本文基于Jetson TX2 (Jetpack3.3版本)制作~

步骤1、硬件连接 (12V供电+网口直连TX2和激光雷达)

硬件连接.png

步骤2、安装ROS Kenitic (Enter TX2 shell)

完整安装ROS 脚本(install_ros_tx2.sh),安装过程大约需要20-30分钟视网络情况!

#!/bin/bash
# Install Robot Operating System (ROS) on NVIDIA Jetson TX2
# Maintainer of ARM builds for ROS is http://answers.ros.org/users/1034/ahendrix/
# Information from:
# http://wiki.ros.org/kinetic/Installation/UbuntuARM
# http://wiki.ros.org/ROS/Installation/UbuntuMirrors

# Setup sources.lst
sudo apt-add-repository universe
sudo apt-add-repository multiverse
sudo apt-add-repository restricted

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Setup keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116
# Installation
sudo apt-get update
sudo apt-get install ros-kinetic-ros-base -y

# Auto install rviz
sudo apt-get install ros-kinetic-desktop-full

#
# To find available packages:
# apt-cache search ros-kinetic
# 
# Initialize rosdep
sudo apt-get install python-rosdep -y
# Certificates are messed up
sudo c_rehash /etc/ssl/certs
# Initialize rosdep
sudo rosdep init
# To find available packages, use:
rosdep update
# Environment Setup
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
# Install rosinstall
sudo apt-get install python-rosinstall -y

步骤3、创建ROS Catkin工作目录

Create a ROS Catkin workspace to contain our ROS packages:

# create the catkin workspace
mkdir -p ~/work/catkin_ws/src
cd ~/work/catkin_ws
catkin_make

# add catkin_ws path to bashrc
sudo sh -c 'echo "source ~/work/catkin_ws/devel/setup.bash" >> ~/.bashrc'

步骤4、安装镭神ROS SDK 到TX2,并运行界面环境

当前点云 Demo未运行任何算法,整体的浏览点云画面是非常的流畅!

  • 先复制ROS驱动-C16/lslidar_C16 到 ~/work/catkin_ws/src
  • 运行
    cd ~/work/catkin_ws
    catkin_make
  • 启动ROS 环境
    nvidia@tegra-ubuntu:~/work/catkin_ws$ source devel/setup.bash
    nvidia@tegra-ubuntu:~/work/catkin_ws$ roslaunch lslidar_c16_decoder lslidar_c16.launch --screen
  • 重新打开一个终端Terminal
    nvidia@tegra-ubuntu:~/work/catkin_ws$ rosrun rviz rviz
  • 即出现ROS界面环境,打开点云图设置即可查看雷达点云画面
laser_tx2.gif
#运行命令
nvidia@tegra-ubuntu:~/work/catkin_ws$ roslaunch lslidar_c16_decoder lslidar_c16.launch --screen
... logging to /home/nvidia/.ros/log/57e11398-9342-11e9-8105-00044bc506d1/roslaunch-tegra-ubuntu-30918.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://tegra-ubuntu:37416/

SUMMARY
========

PARAMETERS
 * /lslidar_c16_decoder_node/angle_disable_max: 0
 * /lslidar_c16_decoder_node/angle_disable_min: 0
 * /lslidar_c16_decoder_node/channel_num: 8
 * /lslidar_c16_decoder_node/child_frame_id: laser_link
 * /lslidar_c16_decoder_node/frequency: 10.0
 * /lslidar_c16_decoder_node/max_range: 150.0
 * /lslidar_c16_decoder_node/min_range: 0.15
 * /lslidar_c16_decoder_node/point_num: 2000
 * /lslidar_c16_decoder_node/publish_channels: True
 * /lslidar_c16_decoder_node/publish_point_cloud: True
 * /lslidar_c16_decoder_node/use_gps_ts: False
 * /lslidar_c16_driver_node/device_ip: 192.168.1.200
 * /lslidar_c16_driver_node/device_port: 2368
 * /lslidar_c16_driver_node/frame_id: laser_link
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /
    lslidar_c16_decoder_node (lslidar_c16_decoder/lslidar_c16_decoder_node)
    lslidar_c16_driver_node (lslidar_c16_driver/lslidar_c16_driver_node)

auto-starting new master
process[master]: started with pid [30928]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 57e11398-9342-11e9-8105-00044bc506d1
process[rosout-1]: started with pid [30941]
started core service [/rosout]
process[lslidar_c16_driver_node-2]: started with pid [30955]
process[lslidar_c16_decoder_node-3]: started with pid [30959]
[ INFO] [1561024879.186346062]: Opening UDP socket: address 192.168.1.200
[ INFO] [1561024879.186511978]: Opening UDP socket: port 2368
[ INFO] [1561024879.186634312]: expected frequency: 833.333 (Hz)
[ INFO] [1561024879.190681810]: Opening UDP socket: port 2368
[ INFO] [1561024879.190978444]: Initialised lslidar c16 without error
[ WARN] [1561024879.331441603]: Using GPS timestamp or not 0
[ INFO] [1561024879.729416788]: default channel is 8


问题1、apt-get install ros 失败时可尝试更换source 源

# http://wiki.ros.org/ROS/Installation/UbuntuMirrors
sudo sh -c 'echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

问题2、 apt-get update 出现NO_PUBKEY F42ED6FBAB17C654

W: GPG error: http://packages.ros.org/ros/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
W: The repository 'http://packages.ros.org/ros/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.

解决:
nvidia@tegra-ubuntu:~/$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F42ED6FBAB17C654
Executing: /tmp/tmp.uFGBtaNcaY/gpg.1.sh --recv-keys
--keyserver
keyserver.ubuntu.com
F42ED6FBAB17C654
gpg: requesting key AB17C654 from hkp server keyserver.ubuntu.com
gpg: key AB17C654: public key "Open Robotics " imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
nvidia@tegra-ubuntu:~/$ sudo apt-get update

你可能感兴趣的:(Jetson TX2 安装应用镭神激光模块(基于ROS))