gpt4 book ai didi

controller - Controller_manager : [ERROR] Controler Spawner couldn't find the expected controller_manager ROS interface

转载 作者:行者123 更新时间:2023-12-03 09:06:48 27 4
gpt4 key购买 nike

我知道已经有很多关于此特定错误的问题,但是我发现的这些问题都没有为我解决问题...

我正在尝试为凉亭中的两轮机器人实现ROS差动驱动 Controller ,但是当启动 Controller 生成器时,我得到以下输出:

[INFO] [1585302057.569863, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
[WARN] [1585302087.735023, 40.162000]: Controller Spawner couldn't find the expected controller_manager ROS interface.

实际上,尝试列出controller_manager服务不会给出任何输出:
$ rosservice list | grep controller_manager
$

我在Ubuntu 18.04上运行ros melodic。

这是我的配置文件 diff_drive.yaml:
wheelchair_controler:
type : "diff_drive_controller/DiffDriveController"
left_wheel : 'left_wheel_motor'
right_wheel : 'right_wheel_motor'
publish_rate: 50.0 # default: 50
pose_covariance_diagonal : [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]

# Wheel separation and diameter. These are both optional.
# diff_drive_controller will attempt to read either one or both from the
# URDF if not specified as a parameter
wheel_separation : 0.52
wheel_radius : 0.3048

# Wheel separation and radius multipliers
wheel_separation_multiplier: 1.0 # default: 1.0
wheel_radius_multiplier : 1.0 # default: 1.0

# Velocity commands timeout [s], default 0.5
cmd_vel_timeout: 0.25

# Base frame_id
base_frame_id: base_link #default: base_link

# Velocity and acceleration limits
# Whenever a min_* is unspecified, default to -max_*
linear:
x:
has_velocity_limits : true
max_velocity : 1.0 # m/s
min_velocity : -0.5 # m/s
has_acceleration_limits: true
max_acceleration : 0.8 # m/s^2
min_acceleration : -0.4 # m/s^2
has_jerk_limits : true
max_jerk : 5.0 # m/s^3
angular:
z:
has_velocity_limits : true
max_velocity : 1.7 # rad/s
has_acceleration_limits: true
max_acceleration : 1.5 # rad/s^2
has_jerk_limits : true
max_jerk : 2.5 # rad/s^3


这是启动文件。我试图将生成器放在单独的启动文件中,以确保凉亭增加了正常启动的时间。
<?xml version="1.0"?>
<launch>

<!-- Controllers -->
<rosparam file="$(find wheelchair_simulation)/config/diff_drive.yaml" command="load" />
<node name="wheelchair_controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="wheelchair_controler" />


</launch>


.xacro文件中,我使用宏来定义车轮,关节和凉亭标签。我还在其中添加了一个传输:
<xacro:macro name="main_wheel" params="prefix reflect">
<link name="main_${prefix}_wheel">
<visual>
<geometry>
<cylinder length="${main_wheel_length}" radius="${main_wheel_radius}"/>
</geometry>
<material name="black"/>
</visual>
<collision>
<geometry>
<cylinder length="${main_wheel_length}" radius="${main_wheel_radius}"/>
</geometry>
</collision>
<inertial>
<xacro:cylinder_inertia length="${main_wheel_length}" radius="${main_wheel_radius}" weight="${main_wheel_mass}"/>
</inertial>
</link>

<joint name="${prefix}_wheel_motor" type="continuous">
<axis xyz="0 0 1"/>
<parent link="base_link"/>
<child link="main_${prefix}_wheel"/>
<origin rpy="${-reflect*1.5708} 0 0" xyz="0 ${reflect*((total_width - main_wheel_length)/2 + 0.001)} 0"/>
<gazebo>
<implicitSpringDamper>true</implicitSpringDamper>
</gazebo>
<dynamic friction="0.1"/>
</joint>

<transmission name="${prefix}_wheel_transmission">
<type>transmission_interface/SimpleTransmission</type>
<joint name="${prefix}_wheel_motor">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
</joint>
<actuator name="${prefix}_wheel_motor">
<mechanicalReduction>1</mechanicalReduction>
<hardwareInterface>VelocityJointInterface</hardwareInterface>
</actuator>
</transmission>

<gazebo reference="main_${prefix}_wheel">
<mu1>0.8</mu1>
<mu2>0.8</mu2>
<turnGravityOff>false</turnGravityOff>
<material>Gazebo/Black</material>
</gazebo >
</xacro:macro>

我确保安装 gazebo_ros_controle:
$ sudo apt-get install ros-melodic-gazebo-ros-controle

并将其链接到我的描述文件中:
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_contol.so">
</plugin>
</gazebo>

最后,我检查了依赖关系,一切看起来都很好:
$ rosdep check controller_manager
All system dependencies have been satisified

编辑:我添加了base_link和base_footprint链接的描述,以防万一,因为有必要我看到 Controller 的框架必须具有惯性
<!-- Dummy link because first link should not have any inertia. Located on the ground between both wheels for easier control -->

<link name="base_footprint"/>

<!-- Footprint and main inertia of the chair -->

<link name="base_link">
<visual>
<geometry>
<box size="${total_length} ${total_width} ${seat_height - ground_clearence}"/>
</geometry>
<origin xyz="${-main_wheel_radius + total_length/2} 0 ${a}"/>
<material name="white"/>
</visual>
<collision>
<geometry>
<box size="${total_length} ${total_width} ${seat_height - ground_clearence}"/>
</geometry>
<origin xyz="${-main_wheel_radius + total_length/2} 0 ${a+0.1}"/>
</collision>
<inertial>
<xacro:box_inertia height="${seat_height - ground_clearence}" length="${total_length}" width="${total_width}" weight="${total_mass-2*main_wheel_mass}"/>
</inertial>
</link>

<joint name="base_link_joint" type="fixed">
<parent link="base_footprint"/>
<child link="base_link"/>
<origin xyz="${-total_length/2 + main_wheel_radius} 0 ${main_wheel_radius}"/>
</joint>

我衷心希望你们中的一些人能够找到问题,因为我不知道它来自何处……请随时询问任何遗漏的细节。

先感谢您 !!

最佳答案

请检查凉亭日志。如果urdf/xacro文件存在问题,则gazebo不会初始化机器人仿真界面,也不会启动gazebo_ros_control插件。
这里有一个例子。一旦纠正了urdf文件, Controller 就会加载,并且不再出现此错误。

[ INFO] [1598502340.159974962]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1598502340.212629654]: Physics dynamic reconfigure ready.

[ INFO] [1598502340.568106895]: Loading gazebo_ros_control plugin

[ INFO] [1598502340.568395067]: Starting gazebo_ros_control plugin in namespace: /plotter

[ INFO] [1598502340.569824694]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server.

[ERROR] [1598502340.698456387]: This robot has a joint named "link_00__link_01" which is not in the gazebo model.

[FATAL] [1598502340.698639178]: Could not initialize robot simulation interface
正如您在最后两行中所看到的,凉亭还算不错。

关于controller - Controller_manager : [ERROR] Controler Spawner couldn't find the expected controller_manager ROS interface,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60883932/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com