我正在使用hector_quadrotor软件包对ROS Kinetic和Gazebo 7中的四旋翼进行简单的仿真。我在控制器生成器上遇到问题,它提供了一个错误,指出它已经生成了,因此无法加载控制器/速度,因此它无法在启动脚本的^ C出口上卸载任何控制器。解决办法是什么?
修正了我尝试过的方法: rosnode杀死 PS杀 新的终端会议 重新启动电脑 通过服务呼叫手动加载控制器
这是我正在使用的启动文件XML
<launch>
<!-- Start Gazebo with empty world running in realtime -->
<include file="$(find gazebo_ros)/launch/empty_world.launch"/>
<group ns="drone1">
<!-- Spawn simulated quadrotor uav leader -->
<include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor.launch">
<arg name="name" value="drone1"/>
<arg name="tf_prefix" value="drone1"/>
</include>
</group>
<node pkg="quad_practice" type="hover.py" name="hover"/>
</launch>
这是我在退出时给出的结果错误:
[INFO] [1565393710.796244, 1.214000]: Controller Spawner: Loaded controllers: controller/position, controller/velocity, controller/attitude
[ERROR] [1565393710.799943937, 1.218000000]: Controller 'controller/velocity' is already running
[ERROR] [1565393710.800351, 1.218000]: Failed to start controllers: controller/position, controller/velocity, controller/attitude
^C[hover-12] killing on exit
[drone1/takeoff_action-10] killing on exit
[drone1/landing_action-9] killing on exit
[drone1/pose_action-8] killing on exit
[drone1/estop_relay-7] killing on exit
[drone1/controller_spawner-6] killing on exit
[gazebo_gui-3] killing on exit
[drone1/robot_state_publisher-4] killing on exit
[INFO] [1565393732.639362, 22.352000]: Shutting down spawner. Stopping and unloading controllers...
[gazebo-2] killing on exit
[INFO] [1565393732.640895, 22.353000]: Stopping all controllers...
[drone1/ground_truth_to_tf-5] killing on exit
[ERROR] [1565393732.663383186, 22.361000000]: Could not stop controller 'controller/position' since it is not running
[INFO] [1565393732.663862, 22.361000]: Unloading all loaded controllers...
[INFO] [1565393732.664577, 22.361000]: Trying to unload controller/attitude
[drone1/controller_spawner-6] escalating to SIGTERM
[gazebo-2] escalating to SIGTERM
[WARN] [1565393747.671287, 22.361000]: Controller Spawner error while taking down controllers: transport error completing service call: receive_once[/drone1/controller_manager/unload_controller]: unexpected error [Errno 4] Interrupted system call
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
通常,凉亭关闭过程和控制器卸载必须逐步升级到SIGTERM,然后才能最终崩溃。
在对启动文件进行了更多实验之后,如图所示定义arg值似乎可以解决启动问题。
<include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor.launch">
<arg name="controllers" value="
controller/attitude
controller/velocity
controller/position
"/>
</include>
但是,在命名空间下生成时,错误仍然存在。我需要将名称空间添加到控制器吗?
[namespace]/conroller/attitude
编辑2:将生成物添加到启动文件中(如页面顶部XML所示)时,控制器生成器以相同的方式失败。有没有更好的方法来创建节点?