当前位置:网站首页>ROS2机器人f1tenth之CLI工具基础
ROS2机器人f1tenth之CLI工具基础
2022-06-29 15:34:00 【zhangrelay】
案例适用于ROS2如下三个版本:
- humble
- galactic
- foxy
适用于win/linux/macos。
为何选择f1tenth,延续性,之前使用f1tenth的ros1进行案例讲解。
具体可以参考如下链接:
蓝桥ROS之f1tenth简单PID沿墙跑起来(Python)
ROS2基础教程可以参考:
课程教程迭代更新只有进行时,没有完成时。
f1tenth资源需求量非常小,适合课程教学,并无缝支持云端实践,以此为主。
善于使用各类帮助文档,例如:
ros2 -h
命令会列出所有ros2的CLI命令:
[email protected]:~$ ros2 -h
usage: ros2 [-h] [--use-python-default-buffering] Call `ros2 <command> -h` for more detailed usage. ...
ros2 is an extensible command-line tool for ROS 2.
options:
-h, --help show this help message and exit
--use-python-default-buffering
Do not force line buffering in stdout and instead use the python default buffering, which
might be affected by PYTHONUNBUFFERED/-u and depends on whatever stdout is interactive or not
Commands:
action Various action related sub-commands
bag Various rosbag related sub-commands
component Various component related sub-commands
daemon Various daemon related sub-commands
doctor Check ROS setup and other potential issues
interface Show information about ROS interfaces
launch Run a launch file
lifecycle Various lifecycle related sub-commands
multicast Various multicast related sub-commands
node Various node related sub-commands
param Various param related sub-commands
pkg Various package related sub-commands
run Run a package specific executable
security Various security related sub-commands
service Various service related sub-commands
topic Various topic related sub-commands
wtf Use `wtf` as alias to `doctor`
Call `ros2 <command> -h` for more detailed usage.默认系统环境导入:
source /opt/ros/humble/setup.bash
自定义功能包环境导入,在对应文件夹下:
~/ros_ws/f1tenth_gym_ros$ source install/setup.sh
查看系统变量:
printenv | grep -i ROS

使用F1tenth和rqt:
~/ros_ws/f1tenth_gym_ros$ ros2 launch f1tenth_gym_ros gym_bridge_launch.py

试一试如下命令:
- ros2 node list
- ros2 topic list
- ros2 service list
- ros2 action list
[email protected]:~$ ros2 topic list
/bond
/clicked_point
/clock
/cmd_vel
/diagnostics
/drive
/ego_racecar/odom
/ego_robot_description
/goal_pose
/initialpose
/joint_states
/map
/map_server/transition_event
/map_updates
/parameter_events
/rosout
/scan
/tf
/tf_static
[email protected]:~$ ros2 service list
/bridge/describe_parameters
/bridge/get_parameter_types
/bridge/get_parameters
/bridge/list_parameters
/bridge/set_parameters
/bridge/set_parameters_atomically
/ego_robot_state_publisher/describe_parameters
/ego_robot_state_publisher/get_parameter_types
/ego_robot_state_publisher/get_parameters
/ego_robot_state_publisher/list_parameters
/ego_robot_state_publisher/set_parameters
/ego_robot_state_publisher/set_parameters_atomically
/lifecycle_manager_localization/describe_parameters
/lifecycle_manager_localization/get_parameter_types
/lifecycle_manager_localization/get_parameters
/lifecycle_manager_localization/is_active
/lifecycle_manager_localization/list_parameters
/lifecycle_manager_localization/manage_nodes
/lifecycle_manager_localization/set_parameters
/lifecycle_manager_localization/set_parameters_atomically
/map_server/change_state
/map_server/describe_parameters
/map_server/get_available_states
/map_server/get_available_transitions
/map_server/get_parameter_types
/map_server/get_parameters
/map_server/get_state
/map_server/get_transition_graph
/map_server/list_parameters
/map_server/load_map
/map_server/map
/map_server/set_parameters
/map_server/set_parameters_atomically
/rviz/describe_parameters
/rviz/get_parameter_types
/rviz/get_parameters
/rviz/list_parameters
/rviz/set_parameters
/rviz/set_parameters_atomically
[email protected]:~$ ros2 node list
/bridge
/ego_robot_state_publisher
/lifecycle_manager_localization
/map_server
/rviz
/transform_listener_impl_55c114fc5430
[email protected]:~$ ros2 action listrqt 或 rqt --force-discover
rqt --help
usage: main.py [-b BINDING] [--clear-config] [-f] [--force-discover] [-h] [-ht] [-l] [-p PERSPECTIVE]
[--perspective-file PERSPECTIVE_FILE] [--reload-import] [-s PLUGIN] [-t] [-v]
[--args [PLUGIN_ARGS ...]] [--list-perspectives] [--list-plugins] [--command-pid PID]
[--command-start-plugin PLUGIN] [--command-switch-perspective PERSPECTIVE]Options for GUI instance:
-b BINDING, --qt-binding BINDING
choose Qt bindings to be used [pyqt|pyside]
--clear-config clear the configuration (including all perspectives and plugin settings)
-f, --freeze-layout freeze the layout of the GUI (prevent rearranging widgets, disable undock/redock)
--force-discover force a rediscover of plugins
-h, --help show this help message and exit
-ht, --hide-title hide the title label, the icon, and the help button (combine with -l and -f to eliminate the
entire title bar and reclaim the space)
-l, --lock-perspective
lock the GUI to the used perspective (hide menu bar and close buttons of plugins)
-p PERSPECTIVE, --perspective PERSPECTIVE
start with this named perspective
--perspective-file PERSPECTIVE_FILE
start with a perspective loaded from a file
--reload-import reload every imported module
-s PLUGIN, --standalone PLUGIN
start only this plugin (implies -l). To pass arguments to the plugin use --args
-t, --on-top set window mode to always on top
-v, --verbose output qDebug messages
--args [PLUGIN_ARGS ...]
arbitrary arguments which are passes to the plugin (only with -s, --command-start-plugin or
--embed-plugin). It must be the last option since it collects all following options.Options to query information without starting a GUI instance:
These options can be used to query information about valid arguments for various options.--list-perspectives list available perspectives
--list-plugins list available pluginsOptions to operate on a running GUI instance:
These options can be used to perform actions on a running GUI instance.--command-pid PID pid of the GUI instance to operate on, defaults to oldest running GUI instance
--command-start-plugin PLUGIN
start plugin
--command-switch-perspective PERSPECTIVE
switch perspectiveSpecial options for embedding widgets from separate processes:
These options should never be used on the CLI but only from the GUI code itself.

---
边栏推荐
猜你喜欢

C # learning 1: value type and reference type

面试官:说一下MySQL事务隔离级别?

Andorid Jetpack Hilt

MySQL XA distributed transaction

89. (cesium article) cesium aggregation diagram (custom picture)

《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(五)

mysql XA 分布式事务

89.(cesium篇)cesium聚合图(自定义图片)
![中序和后序遍历构建二叉树[递归划分区间与回溯拼接子树+中后序和中前序的相似与不同]](/img/c6/a2780620fef8bc5f7b564ef173f589.png)
中序和后序遍历构建二叉树[递归划分区间与回溯拼接子树+中后序和中前序的相似与不同]

2022年第一季度保险服务数字化跟踪分析
随机推荐
LeetCode-64-最小路径和
Motion capture system for apple picking robot
postgresql源码学习(25)—— 事务日志⑥-等待日志写入完成
有望显著提高集成光子电路的计算性能,清华团队提出了一种衍射图神经网络框架
PostgreSQL source code learning (25) -- transaction log ⑥ - wait for log writing to complete
Alibaba cloud experience Award: use polardb-x and Flink to build a large real-time data screen
File常用工具類, 流相關運用 (記錄)
C SQLite class library
企业转型升级之道:数字化转型,思想先行
13.TCP-bite
mysql XA 分布式事务
C語言大作業——匹配系統
防范企业数据泄露,就用网络安全产品堡垒机!
postgresql源码学习(23)—— 事务日志④-日志组装
MySQL定时整库备份&滚动删除指定日期前的备份数据
EasyGBS调用获取实时快照接口时,出现白色方块该如何解决?
2022 OpenVINO DevCon 大揭秘!英特尔携众多合作伙伴深化开发者生态建设,释放AI产业创新潜能
Deeply understand promise's hand and teach you to write a version
商业智能BI与业务管理决策思维之三:业务质量分析
架构实战营模块五作业