栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

ROS操作备忘

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ROS操作备忘

基础操作 1.创建工作空间并初始化
mkdir -p custom_ws/src
cd customworkspace_ws
catkin_make
2.进入/custom_ws/src创建ros包并添加依赖
cd src
catkin_create_pkg custom_pkg roscpp rospy std_msgs
3.进入 /custom_ws/src/custom_pkg添加scripts目录并编辑Python文件
cd custom_pkg
mkdir scripts
4.在/custom_ws/src/custom_pkg/scripts下编写Python文件file1.py、file2.py 5.为Python文件添加可执行权限
chmod +x file1.py
chmod +x file2.py
6.编辑/custom_ws/src/custom_pkg下的 CamkeList.txt文件
catkin_install_python(PROGRAMS
	scripts/file1.py
	scripts/file2.py
	DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
7.进入/custom_ws目录并编译
cd custom_ws
catkin_make
8.执行ROS
#命令行窗口1
roscore

#命令行窗口2
cd custom_ws
source ./devel/setup.bash
rosrun custom_pkg file1.py

#命令行窗口3
cd custom_ws
source ./devel/setup.bash
rosrun custom_pkg file2.py
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/846423.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号