ubuntu16.04 + ros kinetic 安装hokuyo雷达驱动 urg_node

hokuyo接头为网口。

附录一个我之前编译好的包吧。可以直接下载测试使用urg_node github.

1. apt 安装

驱动安装:

sudo apt install ros-kinetic-urg-node

安装依赖

sudo apt install ros-kinetic-urg-c
sudo apt install ros-kinetic-laser-proc

博主apt 安装的,运行激光节点的时候会报段错误,故将其卸载了,重新源码编译的

 

2. 源码编译 

mkdir -p urg_ws/src && cd urg_ws/src

git clone https://github.com/ros-drivers/driver_common.git

git clone https://github.com/ros-perception/laser_proc.git

git clone https://github.com/ros-drivers/urg_c.git

cd ../

catkin_make 

cd src

git clone https://github.com/ros-drivers/urg_node.git

cd ../ && catkin_make

网上很多博客都是进行到上面这一步,基本就编译过了,博主在编译urg_node的时候报错boost某个函数未定义,如下图

解决方法:urg_node.cpp中 报错的一个函数替换成了std的,当然这不是最好的方法。记得添加相应的thread头文件

//        boost::this_thread::sleep(boost::posix_time::milliseconds(10));
    std::this_thread::sleep_for(std::chrono:: milliseconds (10)); 

3. 网络配置


hokuyo激光雷达的默认ip地址为:192.168.0.10
本机静态ip为:192.168.0.20 (可以设定同网段的其他ip)

或者

sudo gedit /etc/network/interfaces 

修改为以下内容(eth0为网桥ip地址,如果网桥名不为eth0,改为相应的即可)

   auto lo  
    iface lo inet loopback
    
    auto eth0  
    allow-hotplug eth0  
    iface eth0 inet static  
          address 192.168.0.20  
          netmask 255.255.255.0 

4. 启动roscore

roscore

5. 启动激光 

rosrun urg_node urg_node _ip_address:=192.168.0.10

6. rviz 查看激光数据

 

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ppipp1109

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值