admin 管理员组文章数量: 887039
【1
任务一:运行小乌龟节点
(1)roscore
(2)rosrun turtlesim turtlesim_node
(3)rosrun turtlesim turtle_teleop_key
任务二:创建一个简单节点
mkdir -p ~/robot_ws/src
cd ~/robot_ws/src
catkin_init_workspace
cd ~/robot_ws
catkin_make
cd ~/robot_ws/src
catkin_create_pkg hello roscpp rospy std_msgs
cd ~/robot_ws
catkin_make
cd ~/robot_ws/src/hello
mkdir scripts
cd scripts
touch hello.py
gedit hello.py
#!/usr/bin/env python
import rospy
import timeif __name__=="__main__":rospy.init_node("Hello")time.sleep(1)rospy.loginfo("Hello World")
chmod +x hello.py
catkin_install_python(PROGRAMS
scripts/hello.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} )
cd ~/robot_ws
catkin_make
roscore (另外打开一个终端
source ./devel/setup.bash
rosrun hello hello.py
(新端1)
🔺mentioin~
本文标签: 1
版权声明:本文标题:【1 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1687671480h127300.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论