ROS入门-roslaunch控制远程程序启动

1. 配置本地ubuntu环境

sudo vim /etc/hosts (添加)

192.168.2.22    ubuntu0556
192.168.2.4 firefly

vim ~/.bashrc (添加)

export ROS_IP="192.168.2.22"
export ROS_HOSTNAME=ubuntu0556
export ROS_MASTER_URI=http://ubuntu0556:11311
export ROSLAUNCH_SSH_UNKNOWN=1

2. 配置firefly 环境

sudo vim /etc/hosts (添加)

192.168.2.22    ubuntu0556
192.168.2.4 firefly

vim ~/.bashrc (添加)

export ROS_HOSTNAME=firefly
export ROS_MASTER_URI=http://ubuntu0556:11311
export ROSLAUNCH_SSH_UNKNOWN=1

vim /opt/ros/indigo/joey_env.sh

#!/bin/sh
export ROS_IP=192.168.2.4 
export ROS_HOSTNAME=firefly
. /home/firefly/joey2/devel/setup.sh
exec "$@"

3. 编写ubuntu端实例程序

参照之前编写的talker/listener步骤编写joey工作区下ex0316工作包
source 到当前工作区下

4. 编写firefly端实例程序

参照之前编写的talker/listner步骤编写joey2工作区下joey_talker工作包

5. ubuntu下编写launch文件

vim ~/joey/src/ex0316/try.launch








6 运行程序

roslaunch ex0316 try.launch

你可能感兴趣的:(ROS入门-roslaunch控制远程程序启动)