ROS_Kinetic_18 使用V-Rep3.3.1和Matlab2015b(vrep_ros_bridge)续

ROS_Kinetic_18 使用V-Rep3.3.1和Matlab2015b(vrep_ros_bridge)续

上一节配置的v-rep在ros kinetic中是可以看图像,并订阅主题的,但是无法发送消息让机器人动起来,

在Top启发下,研究了一下,终于解决了,官方提供的正对3.3.1版本的vrep需要额外的步骤。

ln -s compiledRosPlugins/libv_repExtRos.so 

配置后在kinetic中是会报错的,这时候需要重新编译生成该文件。

1 编译生成

这里,需要注意catkin_make和catkin build的区别,并灵活使用。

复制在v-rep安装目录ros_packages到catkin_relay/src中:

/home/relaybot/Rob_Soft/V-REP_PRO_EDU_V3_3_1_64_Linux/programming/externalIkDemo1/ros_packages

需要修改,其中CMakeLists.txt,加入:

link_directories("/opt/ros/kinetic/lib")

使其可以用于kinetic,需要修改多处。然后编译,这里推荐用catkin build:

~$ cd catkin_relay/
~/catkin_relay$ catkin build


完成后,就可以在devel/lib下看到新的.so。


~/Rob_Soft/V-REP_PRO_EDU_V3_3_1_64_Linux$ ln /home/relaybot/catkin_relay/devel/lib/libv_repExtRosBridge.so
~/Rob_Soft/V-REP_PRO_EDU_V3_3_1_64_Linux$ ln /home/relaybot/catkin_relay/devel/lib/libv_repExtRos.so

这时,启动./vrep.sh,就不会出错了。

2 图像识别

分别启动roscore和v-rep。

打开Pioneer_p3dx_traj_DEMO.ttt场景并运行。

新打开一个终端,运行:

~$ roslaunch demo_pioneer demo-visual-servo-pioneer-simulation.launch 

图像被标记出。这里需要用到visp,demo_pioneer等。

3 控制机器人

~$ rosrun rqt_publisher rqt_publisher 


4 Matlab

Matlab2015b之后版本可以直接使用ROS,测试过indigo和kinetic都没有问题。也可以用matlab直接和vrep调试。


最后补一组图,ros和vrep控制空中机器人也很方便的。


-End-

posted on 2016-06-16 13:54  王亮1  阅读(233)  评论(0编辑  收藏  举报

导航