当前位置:网站首页>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计算图功能
边栏推荐
猜你喜欢
随机推荐
Practical application of WebSocket
Tributyl-mercaptophosphane "tBuBrettPhos Pd(allyl)" OTf), 1798782-17-8
High availability, two locations and three centers
Object类与常用API
获取Ip工具类
typescript43-类型兼容性说明
MOSN 反向通道详解
idea uses @Autowired annotation to explain the reasons and solutions
Alienware上线首个数字时装AR试穿体验
Pr第二次培训笔记
BIOTIN ALKYNE CAS: 773888-45-2 Price, Supplier
4.如何避免缓存穿透、缓存击穿、缓存雪崩
typescript49-交叉类型
FileZilla 搭建ftp服务器
NotImplementedError: file structure not yet supported
Interface Test Framework Practice | Process Encapsulation and Test Case Design Based on Encrypted Interface
ss-3.工程重构
13.
lt.647. Palindromic substring + lt.516. Longest palindrome subsequence GIS数据漫谈(六)— 投影坐标系统
在树莓派上搭建属于自己的网页(2)