当前位置:网站首页>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计算图功能
边栏推荐
- Create a tree structure
- GIS数据漫谈(六)— 投影坐标系统
- 1094 谷歌的招聘 (20 分)
- 《录取通知》 观后感
- Business table analysis - balance system
- ss-2.子项目互相访问(order80 -> payment8001)
- 13.< tag-动态规划和回文字串>lt.647. 回文子串 + lt.516.最长回文子序列
- 轨迹(形状)相似性判断与度量方法
- 【 Harmony OS 】 【 ano UI 】 lightweight data storage
- Build your own web page on the Raspberry Pi (2)
猜你喜欢
web安全-PHP反序列化漏洞
力扣561. 数组拆分
【HMS core】【Ads Kit】Huawei Advertising——Overseas applications are tested in China. Official advertisements cannot be displayed
MySql数据库
Secondary development of WinForm controls
MOSN 反向通道详解
Peptides mediated PEG DSPE of phospholipids, targeted functional materials - PEG - RGD/TAT/NGR/APRPG
Exception(异常) 和 Error(错误)区别解析
js实现一个 bind 函数
深度学习入门之GRU
随机推荐
IO流及其操作
1054 求平均值 (20 分)
Business table analysis - balance system
Djiango第三次培训
HarmonyOS应用开发第一次培训
Ali cloud object storage oss private barrels to generate links
1058 选择题 (20 分)(C语言)
ss-5.consul服务端+生产者+消费者
深度学习入门之GRU
High availability, two locations and three centers
VR全景展打造专属元宇宙观展空间
OptionError: ‘Pattern matched multiple keys‘
13.< tag-动态规划和回文字串>lt.647. 回文子串 + lt.516.最长回文子序列
HarmonyOS应用开发培训第二次作业
如何不耍流氓的做运维之-SHELL脚本
typescript39-class类的可见修饰符
Power button 561. An array of split
在树莓派上搭建属于自己的网页(1)
13.
lt.647. Palindromic substring + lt.516. Longest palindrome subsequence Length n of condensed distance matrix ‘y‘ must be a binomial coefficient