当前位置:网站首页>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计算图功能
边栏推荐
猜你喜欢

Newifi路由器第三方固件玩机教程,这个路由比你想的更强大以及智能_Newifi y1刷机_smzdm

Alienware上线首个数字时装AR试穿体验

typescript39-class类的可见修饰符

13.
lt.647. Palindromic substring + lt.516. Longest palindrome subsequence 
UV decomposition of biotin - PEG2 - azide | CAS: 1192802-98-4 biotin connectors

安装IIS服务(Internet信息服务(Internet Information Services,简写IIS,互联网信息服务)

Secondary development of WinForm controls

web安全-SSTI模板注入漏洞

Install PostgreSQL on Windows
![[Harmony OS] [ArkUI] ets development graphics and animation drawing](/img/36/f4c91f794b1321f11a24505d1617fb.png)
[Harmony OS] [ArkUI] ets development graphics and animation drawing
随机推荐
2. 两数相加
1089 狼人杀-简单版 (20 分)
Alienware上线首个数字时装AR试穿体验
web安全-命令执行漏洞
JDBC与连接池
13.< tag-动态规划和回文字串>lt.647. 回文子串 + lt.516.最长回文子序列
NotImplementedError: file structure not yet supported
《录取通知》 观后感
1079 延迟的回文数 (20 分)
Talking about GIS Data (6) - Projected Coordinate System
在树莓派上搭建属于自己的网页(1)
2017-06-11 Padavan 完美适配newifi mini【adbyby+SS+KP ...】youku L1 /小米mini
【 Harmony OS 】 【 ano UI 】 lightweight data storage
[Harmony OS] [ARK UI] ETS context basic operations
第四次培训
typescript41-class类的私有修饰符
UV decomposition of biotin - PEG2 - azide | CAS: 1192802-98-4 biotin connectors
VR全景展打造专属元宇宙观展空间
typescript42-readonly修饰符
安装IIS服务(Internet信息服务(Internet Information Services,简写IIS,互联网信息服务)