当前位置:网站首页>1.ROS环境搭建与基础工作
1.ROS环境搭建与基础工作
2022-08-03 05:10:00 【janedipan】
1.ROS环境搭建与基础工作
1.ROS体验
1.When the ros system in installed, you can use the command to check for correction installation
# 测试ros是否安装正常
roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
2.Create and initialize <workspace>
# 创建工作空间workspace;
mkdir -p demo01_ws/src
cd demo01_ws/
# 创建功能包package;
catkin_make
cd src
catkin_create_pkg <workspace> roscpp rospy std_msgs
3.Create python files in <space>/scripts/, next add permission and configure CMakeLists.txt
cd ./scriptes/
chmod +x helloworld_p.py
# 查看可执行权限,文件名变成绿色
// CMakeLists.txt
catkin_install_python(PROGAMS
scripts/<my_python_script>
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
6.compile and execute
cd <project>
catkin_make
# 编译
roscore
# 启动ros核心
source ./devel/setup.bash
rosrun <package> <python_node>
2.vscode配置环境
1.create ros workspace
mkdir -p <workspace>/src
cd <workspace>
catkin_make
cd <workspace>
code .
# 启用vscode打开<workspace>
2.compile in vscode
use ctrl+shift+b
to choose catkin_make:build
, next configure tasks.json
// tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "catkin_make:debug",
"type": "shell",
"command": "catkin_make",
"args": [],
"group": {
"kind":"build", "isDefault":true},
"presentation":{
"reveal": "always"},
"problemMatcher": "$msCompile"
}
]
}
3.create package in vscode
在<workspace_name>/srt 下右击 Create Catkin Package
<package_name>
<roscpp, rospy, std_msgs>
4.create python_node.py, add permission and configure CMakeLists.txt.
use ctrl+shift+b
to configure package
use rospack profile
to refresh package directory
3.ROS系统相关指令
catkin_create_pkg <package>
sudo apt install <package>
sudo apt purge <package>
rospack list //列出所有功能包
rospack find <package> //搜索包路径并返回
roscd <package> //进入某个功能包
rosis <package> //列出某个包下的文件
apt search <package> //搜索某个功能包
apt search ros-noetic-*
rosed <package> <node> //必须使用vim才能打开
roscore //ROS系统先决节点和程序集合,将启动ros master,ros参数服务器,rosout日志
rosrun <package> <node> //运行指定ROS节点
roslaunch <package> <*.launch>
rqt //启动ros计算图功能
边栏推荐
猜你喜欢
Modified BiotinDIAZO-Biotin-PEG3-DBCO|diazo-biotin-tripolyethylene glycol-diphenylcyclooctyne
typescript46-函数之间的类型兼容性
Common lipophilic cell membrane dyes DiO, Dil, DiR, Did spectrograms and experimental procedures
Shell conditional statement judgment
深度学习入门之GRU
typescript47-函数之间的类型兼容性
在树莓派上搭建属于自己的网页(1)
Secondary development of WinForm controls
2017-06-11 Padavan 完美适配newifi mini【adbyby+SS+KP ...】youku L1 /小米mini
Build your own web page on the Raspberry Pi (2)
随机推荐
1089 狼人杀-简单版 (20 分)
Super handy drawing tool is recommended
minio下载文件乱码或者是一条横线
Coordinate knowledge in digital twin campus scenarios
web安全-PHP反序列化漏洞
Install IIS services (Internet Information Services (Internet Information Services, abbreviated IIS, Internet Information Services)
3. 无重复字符的最长子串
OptionError: ‘Pattern matched multiple keys‘
Detailed explanation of MOSN reverse channel
Length n of condensed distance matrix ‘y‘ must be a binomial coefficient
集合框架知识
【Flask】Flask-SQLAlchemy的增删改查(CRUD)操作
IO process thread -> thread -> day5
Object类与常用API
Harmony OS ets ArkUI 】 【 】 the development basic page layout and data connection
IO流及其操作
建立树形结构
UV decomposition of biotin - PEG2 - azide | CAS: 1192802-98-4 biotin connectors
Redis6学习笔记
[Harmony OS] [ARK UI] ETS context basic operations