# ROS **Repository Path**: SamsonWang/ROS ## Basic Information - **Project Name**: ROS - **Description**: 基于Ubuntu 16.04的ROS系统搭建。 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2018-10-24 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ROS #### 项目介绍 基于Ubuntu 16.04的ROS系统搭建。 #### 软件架构 软件架构说明 #### 安装教程 1. [安装Ubuntu](https://www.ubuntu.com/download/desktop ) 2. [安装ROS · 中国大学MOOC———《机器人操作系统入门》讲义](https://sychaichangkun.gitbooks.io/ros-tutorial-icourse163/content/chapter1/1.4.html) 3. [DroidAITech/ROS-Academy-for-Beginners: 中国大学MOOC《机器人操作系统入门》课程代码示例](https://github.com/DroidAITech/ROS-Academy-for-Beginners) 4. [cn - ROS Wiki](http://wiki.ros.org/cn) 5. [ROS Kinetic 安装指南-Ubuntu中安装ROS Kinetic](http://wiki.ros.org/cn/kinetic/Installation/Ubuntu) 6. [Ubuntu 16.04 + ROS Kinetic 学习镜像](http://blog.exbot.net/archives/2972) 7. [ROS机器人程序设计(原书第2版)学习镜像分享及使用说明](https://blog.csdn.net/zhangrelay/article/details/53324759) 8. [Ubuntu 16.04和ROS Kinetic 学习镜像](https://pan.baidu.com/s/1hulIXwC) 密码: 7udr 9. [将Linux(ubuntu)安装到U盘上,实现即插即用 - 木子的博客 - CSDN博客](https://blog.csdn.net/qq_24369113/article/details/53179218) 10. [ExBot易科机器人实验室 | 致力于机器人技术的创新与分享](http://blog.exbot.net/) 单击桌面Install Exbotbook 无反应?尝试如下指令 ``` $ sudo sh -c 'ubiquity gtk_ui' 密码:exbot ``` #### 使用说明 1. Persistent configuration using interfacesFor systems not using Network Manager or that are not configured by UI the settings for the VLAN can be added to the ``` /etc/network/interfaces. ``` ``` # The parent interface # 请使用ifconfig查看电脑的网卡名称,这里是enp0s25。下同 auto enp0s25 iface enp0s25 inet static address 192.168.1.26 netmask 255.255.255.0 # The VLAN interface auto enp0s25.101 iface enp0s25.101 inet static vlan-raw-device enp0s25 address 10.1.0.81 netmask 255.255.0.0 #The route for libeCAL can be added to the loopback device: auto lo iface lo inet loopback post-up route add -net 239.0.0.0 netmask 255.0.0.0 dev lo ``` 2. Configuration using ip ##### Install the vlan package: ``` $ sudo apt install vlan ``` ##### Load the current Kernel module: ``` $ sudo modprobe 8021q ``` ##### Add the VLAN interface ``` $ sudo vconfig add enp0s25 101 ``` ##### Added VLAN with VID == 101 to IF -:enp0s25:- Set the IP address for the new interface ``` $ sudo ip addr add 10.1.0.81/8 dev enp0s25.101 ``` ##### Bring up the interface ``` $ sudo ip link set enp0s25.101 up ``` 3. PTPd Setup on Ubuntu 16.04 The following steps are necessary to enable PTP (Precision Time Protocol) synchronization on Ubuntu 16.04 1) Install the ptpd package. This can usually be done by "apt install ptpd" ``` $sudo apt install ptpd ``` Reading package lists... Done Building dependency tree Reading state information... Done ptpd is already the newest version (2.3.1-debian1-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 2) Edit /etc/default/ptpd, enable the daemon and add the configuration file. ``` $ cat /etc/default/ptpd ``` ``` # /etc/default/ptpd # Set to "yes" to actually start ptpd automatically START_DAEMON=yes # Add command line options for ptpd PTPD_OPTS="-c /etc/ptpd2.conf" ``` 3) Edit the configuration file for ptpd. You might need to change the interface to match your configuration. ``` $ cat /etc/ptpd2.conf ``` ``` ; RADAR dev kit configuration [ptpengine] interface = enp0s25.101 transport = ethernet preset = masteronly delay_mechanism = E2E disable_bmca = y ``` 4) Check if the configuration file can be parsed successfully. ``` $ ptpd -k -c /etc/ptpd2.conf ``` Configuration OK 5) Start the service and check the status ``` $ service ptpd start ``` ``` $ service ptpd status ``` ``` ● ptpd.service - LSB: start and stop ptpd Loaded: loaded (/etc/init.d/ptpd; bad; vendor preset: enabled) Active: active (running) since Mo 2018-07-09 12:54:37 CEST; 23min ago Docs: man:systemd-sysv-generator(8) CGroup: /system.slice/ptpd.service └─11973 /usr/sbin/ptpd -c /etc/ptpd2.conf ``` 6) To check if the sensor receives the messages a. Check the current system timestamp: ``` $ date +%s ``` b. Check the timestamp in the monitoring tool, it should match the system timestamp. c. Power cycle the sensor. It will jump back to the system timestamp after a short delay of about a second. #### Frequently Asked Questions Q: The PTP daemon is running, the interface is correct but none of the sensors show the system timestamp A: This might be an issue with VLAN handling in certain network adapters. The behavior can be changed with ethtool. Make sure you use the same interface you use for PTP and execute the following commands: ``` $ ethtool -K txvlan off $ ethtool -K rxvlan off ```