12.3-rosaria使用总结

在p3at上使用ROS环境

前言

  • 对之前的工作进行总结,并彻底改进和解决激光连接问题

TOC

参考

rosaria wiki
ARIA and ARNL Robot Parameters
How ARIA Connects To Lasers
Running a Program at Linux Startup
Ubuntu Linux Network Configuration
Linux C++ Compilers
Laser Rangefinder
SICK LMS-100/LMS-111/LMS-500 Laser Rangefinders
ubuntu 网络配置
ROS 网络连接LMS100
ROS 网络连接LMS5xx

学习记录

ROS环境搭建

deb http://ros.exbot.net/rospackage/ros/ubuntu/ trusty main
ROSARIA
ROS for indigo
to search available packages
apt-cache search ros-indigo
最初只安装一个版本,便把环境变量加进去了
Note that catkin_init_workspace must be run inside the src subdirectory, but catkin_make is used in the parent workspace directory. catkin_init_workspace only needs to be done once in the src directory.
Every time you want to use the catkin workspace to build packages, you must source the special devel/setup.bashscript:
cd catkin_ws
. devel/setup.bash
You must do this for every new shell or terminal window you open.
If you only use one catkin workspace, you can add this command to your .bashrc file, so that it automatically occurs for every new shell or terminal window you run.
For example, if your catkin workspace is catkin_ws in your home directory, edit .bashrc in your home directory and add the following line to the end of the file. The .bashrc file is normally hidden, but you can still reference it to edit it or enable "Show hidden files" in the file browser preferences.
. ~/catkin_ws/devel/setup.bash
If you have multiple catkin workspaces for multiple versions of ROS, you must source the setup file from inside the workspace you want to use.
ARIA for linux
安装ROSARIA后别装单独装ARIA了,会有版本冲突
libaria2.9.deb无法安装,因为电脑中已经有2.8版本,可能是RODARIA的依赖包
kinetic 版本,需要在安装目录重新编译以解决问题。
ros-arnl 安装(还未装)
先安装arnlbase, arnl包>=1.9.2
编译
安装mobilesim,Mapper,MobileEyes

ROSARIA-2.9.1版本

sudo dpkg -i libaria*
tar -zxvf Mapper3-2.2.5.tgz
sudo mv Mapper3-2.2.5 /usr/local/
tar xzf MobileSim-src-0.7.5.tar.gz
export ARIA=/usr/local/Aria
cd ./MobileSim-src-0.7.5
make -j4
sudo make install

基础知识

  • 有一个专门的配置文件,包含串口,网络地址等连接参数,其他传感器的连接参数等,这些文件在ARIA文件目录的./param/中
  • 启动样例
cd /usr/local/Aria/examples
./demo

ROSARIA使用

  • 激光问题

  • 需要特别注意的是:默认网关必须是电脑自己所在的网段中的IP地址,而不能填写其他网段中的IP地址。
  • SICK的正确打开方式是这样的,有两种做法
    • LMS511如果被设成自动获取IP(即DHCP),然后连在一个带路由功能的设备后面(比如路由器),这样路由设备将会给雷达分配动态地址,然后用一台windows电脑运行SOPAS软件自动搜索设备,就能连上了。
    • 如果你没有路由器,你得把LMS511设成静态IP,这样只要把电脑的IP改成和LMS511的IP同一网段就可以直接把LMS511的网线插到电脑上。这时你可以在windows下用SOPAS自动搜索或者在ubuntu下用sicktoolbox驱动都能获取雷达数据。

adept公司官方配置文档

  • Ubuntu 下配置SICK

  • 板载电脑与激光通过交换机连接,通过一个网桥(接入点,比如走廊那个中兴的WAP)与外网连接
  • On Ubuntu, network interface configuration is done via the Network Manager. To change configuration using the GUI interface, click on the network status icon in the desktop status bar, and select "Edit Connections". Select "Wired connection 2" or "Secondary ethernet connection" or "Internal ethernet connection". Set the IP address to 192.168.0.4, with mask 192.168.255.255 and gateway 192.168.0.1 in addition to the main IP address.

单独使用激光

  • 在Ubuntu下依然可以使用以太网和串口两种方式连接激光,此处只介绍以太网方式连接
  • 以太网连接方式接线还是和Windows下一样,依然要手动设定电脑的IP,使电脑和激光在同一网段。
    在Ubuntu下“编辑连接”——“以太网”——“添加”创建一个名为lms511的有线连接,手动设定子网掩码为255.255.255.0,手动设定IP为192.168.0.10(192.168.0.2~192.168.0.254都行),这样此IP与LMS5xx设备IP就处于同一网段了
  • 这时用sicktoolbox2就可以读取激光的数据了

使用ROS包

<launch>
  <arg name="urdf" default="$(find amr_robots_description)/urdf/pioneer3at.urdf" />
  <param name="robot_description" textfile="$(arg urdf)" />
  <node pkg = "rosaria" type = "RosAria" name = "RosAria">
    <param name="port"                      value="/dev/ttyUSB0" type="string"/>
    <param name="publish_aria_lasers"       value="true"/>
    <param name="zsstart_pose_x"            value="0.0"/>
    <param name="zsstart_pose_y"            value="0.0"/>
    <param name="zsstart_pose_th"           value="0.0"/>
  </node>
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
</launch>

猜你喜欢

转载自www.cnblogs.com/lizhensheng/p/11117714.html