# cmd_forward **Repository Path**: yichengchen/cmd_forward ## Basic Information - **Project Name**: cmd_forward - **Description**: 一个ROS功能包,与Prometheus V1.1配合使用。功能:将来自自定义节点的起飞、降落指令以及位置控制指令转发给/prometheus/control_command话题。 - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 1 - **Created**: 2023-05-05 - **Last Updated**: 2023-12-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: ROS ## README # cmd_forward ## 简介 本仓库是一个ROS功能包,与[Prometheus V1.1](https://github.com/amov-lab/Prometheus/tree/v1.1)配合使用。 功能:将来自自定义节点的起飞、降落指令以及位置控制指令转发给Prometheus的`/prometheus/control_command`话题。 ## 下载与编译 ```bash cd /Modules git clone https://gitee.com/yichengchen/cmd_forward.git cd .. catkin_make --source Modules/cmd_forward --build build/cmd_forward ``` ## 数据接口 cmd_forward节点接收两个话题,发布一个话题,详见下表。 | IO | 话题名 | 话题类型 | 内容 | 说明 | | ---- | --------------------------- | ------------------------------ | -------------------------- | ------------------------------------------------ | | 接收 | /flight_mode | std_msgs/String | ‘takeoff’或’land’ | 发送takeoff指令后,无人机将自动解锁,并2秒后起飞 | | 接收 | /pos_cmd | geometry_msgs/PoseStamped | 期望目标点位置 | | | 发布 | /prometheus/control_command | prometheus_msgs/ControlCommand | 转发给Prometheus的控制指令 | | ## 运行测试 首先启动Prometheus: ```bash roslaunch prometheus_gazebo sitl_control.launch ``` 然后启动cmd_forward节点: ```bash rosrun cmd_forward cmd_forward.py ``` 新开一个窗口,测试起飞命令: ```bash rostopic pub /flight_mode std_msgs/String 'takeoff' ``` 测试定点飞行指令: ```bash rostopic pub /pos_cmd geometry_msgs/PoseStamped '{header: {stamp: now, frame_id: "map"}, pose: {position: {x: 3.0, y: 0.0, z: 2.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}' ``` 测试降落指令: ```bash rostopic pub /flight_mode std_msgs/String 'land' ```