ROS小乌龟建立

ROS启动小乌龟 虽然过程还有很多Failed没完全看懂解决,但是还是记录下来好好修正。以下逐条代码实验

建立ROS工作环境——catkin运行:

mkdir -p ~/catkin_ws/src;

cd ~/catkin_ws/src

catkin_init_workspace

cd ~/catkin_ws/ catkin_make

source devel/setup.bash

echo ROS_PACKAGE_PATH//可查看环境变量输出:

root/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

然后进行测试小乌龟的控制需要rosrun turtle_teleop turtle_teleop_key,所以要用源码包安装http://ros.org/wiki/turtle_teleop。下载joystick_drivers-indigo-devel(其中有Ps3joy)跟joystick_drivers_tutorials-master(turtle_teleop)两个包都要放在路径当中,可以放在opt里面的ros中share里面,也可以自己将路径写进去。我的就在catkin_ws里面的

echo "export ROS_PACKAGE_PATH=~/ros_workspace:$ROS_PACKAGE_PATH">> ~/.bashrc

echo "export ROS_WORKSPACE=~/ros_workspac" >> ~/.bashrc

. ~/.bashrc//我认为这个是更新录用路径。

echo $ROS_PACKAGE_PATH

开始安装

ROSPACK find turtle_teleop定位

rosmake turtle_teleop(这里出现大量错误,45个成功建立1个错误,在尝试将ps3joy复制到cofing也不行)

rosdep install turtle_teleop

roscd turtle_teleop

roslaunch launch/turtle_keyboard.launch//启动这个文件可以在此文件找到。此时应该可以use allow keys to move the turtle

重新打开roscore 确保关闭其他ros命

rosrun turtlesim turtlesim_node打开小龟界面

rosrun turtle_teleop turtle_teleop_key(这个还是提示没找到但已经能用了)

重新测试一辩,在第三个新开的终端里再次调用launch才可以做到移动,也就是每一次都要使用以上代码



博主设置当前文章不允许评论。

没有更多推荐了,返回首页