鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    ros2与gazebo通讯问题

    已定时 已固定 已锁定 已移动
    ROS 2相关问题
    gazebo仿真插件之两轮差速 ros2机器人入门到实战
    1
    2
    95
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 6
      623934457
      最后由 编辑

      基础环境:
      ubuntu 24.04
      ros2-jazzy
      gazebo-Harmonic

      目的:
      我在学习本站的【ROS2机器人入门到实战】-Gazebo仿真插件之两轮差速章节中遇到问题,在gazebo中导入模型正常,利用键盘控制模型原地移动正常,在rviz2中模型有显示,但只有轮子在转动,模型不动。fixed frame选项中没有odom。
      gz终端显示如下:
      /d2lros2/chapt8_ws$ ros2 launch fishbot_description gazebo.launch.py
      [INFO] [launch]: All log files can be found below /home/gao/.ros/log/2025-09-17-09-30-35-733771-gao-ThinkPad-L430-8131
      [INFO] [launch]: Default logging verbosity is set to INFO
      [INFO] [gazebo_sim-1]: process started with pid [8135]
      [INFO] [robot_state_publisher-2]: process started with pid [8136]
      [INFO] [spawn_entity-3]: process started with pid [8137]
      [INFO] [joint_state_publisher-4]: process started with pid [8138]
      [INFO] [gz_pose_to_tf-5]: process started with pid [8139]
      [robot_state_publisher-2] [WARN] [1758072636.096789654] [kdl_parser]: The root link base_footprint has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.
      [robot_state_publisher-2] [INFO] [1758072636.097000628] [robot_state_publisher]: Robot initialized
      [gazebo_sim-1] Library error: libgz-tools2-backward.so.2.0.2 not found. Improved backtrace generation will be disabled
      [spawn_entity-3] [INFO] [1758072636.593876496] [ros_gz_sim]: Requesting list of world names.
      [joint_state_publisher-4] [INFO] [1758072637.327276699] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic...
      [gz_pose_to_tf-5] [INFO] [1758072637.482055366] [gz_pose_to_tf]: 节点启动成功,等待Gazebo位姿数据...
      [spawn_entity-3] [INFO] [1758072637.685053793] [ros_gz_sim]: Waiting messages on topic [robot_description].
      [spawn_entity-3] [INFO] [1758072637.690700850] [ros_gz_sim]: Entity creation successful.
      [INFO] [spawn_entity-3]: process has finished cleanly [pid 8137]
      [INFO] [parameter_bridge-6]: process started with pid [8310]
      [parameter_bridge-6] [INFO] [1758072641.079410242] [ros_gz_bridge]: Creating ROS->GZ Bridge: [/cmd_vel (geometry_msgs/msg/Twist) -> /cmd_vel (gz.msgs.Twist)] (Lazy 0)
      [parameter_bridge-6] [INFO] [1758072641.094205656] [ros_gz_bridge]: Creating GZ->ROS Bridge: [/odom (gz.msgs.Odometry) -> /odom (nav_msgs/msg/Odometry)] (Lazy 0)
      [parameter_bridge-6] [INFO] [1758072641.102399569] [ros_gz_bridge]: Creating GZ->ROS Bridge: [/joint_states (gz.msgs.Model) -> /joint_states (sensor_msgs/msg/JointState)] (Lazy 0)
      [parameter_bridge-6] [INFO] [1758072641.124001464] [ros_gz_bridge]: Creating GZ->ROS Bridge: [/model/fishbot_base/tf (gz.msgs.Pose_V) -> /model/fishbot_base/tf (tf2_msgs/msg/TFMessage)] (Lazy 0)
      [parameter_bridge-6] [INFO] [1758072641.135632301] [ros_gz_bridge]: Creating GZ->ROS Bridge: [/clock (gz.msgs.Clock) -> /clock (rosgraph_msgs/msg/Clock)] (Lazy 0)

      ros2 topic list
      /clicked_point
      /clock
      /cmd_vel
      /goal_pose
      /initialpose
      /joint_states
      /model/fishbot_base/tf
      /odom
      /parameter_events
      /robot_description
      /rosout
      /tf
      /tf_static
      /world/default/pose/info

      ros2 topic info /odom
      Type: nav_msgs/msg/Odometry
      Publisher count: 1
      Subscription count: 0

      gz topic -l
      Library error: libgz-tools2-backward.so.2.0.2 not found. Improved backtrace generation will be disabled
      /clock
      /cmd_vel
      /gazebo/resource_paths
      /gui/camera/pose
      /gui/currently_tracked
      /gui/track
      /joint_states
      /model/fishbot_base/pose
      /model/fishbot_base/tf
      /odom
      /stats
      /world/empty/clock
      /world/empty/dynamic_pose/info
      /world/empty/pose/info
      /world/empty/scene/deletion
      /world/empty/scene/info
      /world/empty/state
      /world/empty/stats
      /model/fishbot_base/enable
      /world/empty/light_config
      /world/empty/material_color

      ros2 topic echo /odom
      header:
      stamp:
      sec: 170
      nanosec: 0
      frame_id: odom
      child_frame_id: base_footprint
      pose:
      pose:
      position:
      x: -4.028614228463498e-13
      y: 1.2847207709729211e-12
      z: 0.0
      orientation:
      x: 0.0
      y: -0.0
      z: -0.39562289102470527
      w: -0.9184130487407364
      covariance:

      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
        twist:
        twist:
        linear:
        x: -3.8191672047105385e-12
        y: 0.0
        z: 0.0
        angular:
        x: 0.0
        y: 0.0
        z: -0.6726808822151984
        covariance:
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0

      header:
      stamp:
      sec: 170
      nanosec: 20000000
      frame_id: odom
      child_frame_id: base_footprint
      pose:
      pose:
      position:
      x: -4.5447697525525446e-13
      y: 1.2308509718320058e-12
      z: 0.0
      orientation:
      x: 0.0
      y: -0.0
      z: -0.3894359976925846
      w: -0.9210535292268204
      covariance:

      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
        twist:
        twist:
        linear:
        x: -3.730349362740526e-12
        y: 0.0
        z: 0.0
        angular:
        x: 0.0
        y: 0.0
        z: -0.6726808822145794
        covariance:
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0
      • 0.0

      gz topic -t /odom -i
      Library error: libgz-tools2-backward.so.2.0.2 not found. Improved backtrace generation will be disabled
      Publishers [Address, Message Type]:
      tcp://172.17.0.1:42837, gz.msgs.Odometry
      Subscribers [Address, Message Type]:
      tcp://172.17.0.1:37283, gz.msgs.Odometry

      gz topic -t /odom -e
      Library error: libgz-tools2-backward.so.2.0.2 not found. Improved backtrace generation will be disabled
      header {
      stamp {
      sec: 200
      nsec: 920000000
      }
      data {
      key: "frame_id"
      value: "odom"
      }
      data {
      key: "child_frame_id"
      value: "base_footprint"
      }
      }
      pose {
      position {
      x: 2.5211883694718938e-12
      y: -1.8125757217106408e-13
      }
      orientation {
      z: -0.53805043015990317
      w: 0.84291264945114175
      }
      }
      twist {
      linear {
      x: -1.0658141036401503e-12
      }
      angular {
      z: -0.672680882209628
      }
      }

      header {
      stamp {
      sec: 200
      nsec: 940000000
      }
      data {
      key: "frame_id"
      value: "odom"
      }
      data {
      key: "child_frame_id"
      value: "base_footprint"
      }
      }
      pose {
      position {
      x: 2.5138206233728475e-12
      y: -1.650941404351984e-13
      }
      orientation {
      z: -0.54370832631104715
      w: 0.83927424355811131
      }
      }
      twist {
      linear {
      x: -8.8817841970012523e-13
      }
      angular {
      z: -0.67268088220839006
      }
      }

      header {
      stamp {
      sec: 200
      nsec: 960000000
      }
      data {
      key: "frame_id"
      value: "odom"
      }
      data {
      key: "child_frame_id"
      value: "base_footprint"
      }
      }
      pose {
      position {
      x: 2.5059541819667771e-12
      y: -1.4720778384187288e-13
      }
      orientation {
      z: -0.54934161977662233
      w: 0.83559786068490927
      }
      }
      twist {
      linear {
      x: -1.0658141036401503e-12
      }
      angular {
      z: -0.672680882209628
      }
      }

      launch文件:
      from launch import LaunchDescription
      from launch_ros.actions import Node
      from launch.actions import ExecuteProcess, TimerAction
      from launch_ros.substitutions import FindPackageShare
      import os

      def generate_launch_description():
      # 获取包路径和URDF
      pkg_share = FindPackageShare('fishbot_description').find('fishbot_description')
      urdf_path = os.path.join(pkg_share, 'urdf', 'fishbot_base.urdf')

      with open(urdf_path, 'r') as f:
          robot_desc = f.read()
      
      return LaunchDescription([
          # Gazebo仿真
          ExecuteProcess(
              cmd=['gz', 'sim', '-r', 'empty.sdf'],
              output='screen',
              name='gazebo_sim'
          ),
      
          # 机器人状态发布
          Node(
              package='robot_state_publisher',
              executable='robot_state_publisher',
              name='robot_state_publisher',
              parameters=[{
                  'robot_description': robot_desc,
                  'publish_frequency': 50.0,
                  'use_tf_static': True,      # 启用静态TF
                  'use_sim_time': True
              }]
          ),
      
          # 生成机器人模型
          ExecuteProcess(
              cmd=['ros2', 'run', 'ros_gz_sim', 'create', '-topic', 'robot_description'],
              output='screen',
              name='spawn_entity'
          ),
          Node(
              package='joint_state_publisher',
              executable='joint_state_publisher',
              name='joint_state_publisher',
              parameters=[{
                  'source_list': ['/joint_states'],  # 监听Gazebo发布的关节状态
                  'use_sim_time': True,
                  'rate': 50,
                  'use_sim_time': True
              }]
          ),
          Node(
              package='fishbot_description',
              executable='gz_pose_to_tf',  # 需要创建此Python脚本
              name='gz_pose_to_tf',
              parameters=[{'use_sim_time': True}],
              output='screen'
          ),
          
          #Node(
              #package='tf2_ros',
              #executable='tf2_echo',
              #arguments=['odom', 'base_link'],
              #name='tf_debug',
              #output='screen'
          #),
          #Node(
              #package='tf2_ros',
              #executable='static_transform_publisher',
              #arguments=['0', '0', '0', '0', '0', '0', 'odom', 'base_footprint'],
              #name='static_odom_tf_publisher',
              #parameters=[{'use_sim_time': True}]
          #),
          # 延时启动的ROS-Gazebo桥接
          TimerAction(
              period=5.0,  # 延迟5秒
              actions=[
                  Node(
                      package='ros_gz_bridge',
                      executable='parameter_bridge',
                      arguments=[
                          '/cmd_vel@geometry_msgs/msg/Twist]gz.msgs.Twist',
                          '/odom@nav_msgs/msg/Odometry[gz.msgs.Odometry',                        
                          '/joint_states@sensor_msgs/msg/JointState[gz.msgs.Model',
                          '/model/fishbot_base/tf@tf2_msgs/msg/TFMessage[gz.msgs.Pose_V' ,
                          '/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'  # 同步时钟
                          
                      ],
                      output='screen',
                      #name='gz_bridge'
                  )
              ]
          )
      ])
      

      urdf文件:
      <?xml version="1.0"?>
      <robot name="fishbot_base">
      <!--2025-07-14修改,
      ros2 launch fishbot_description gazebo.launch.py 在gz中显示-->

      <!-- Robot Footprint -->
      <gazebo>
      <plugin filename='libgz-sim8-diff-drive-system.so' name='gz::sim::systems::DiffDrive'>

        <update_rate>30</update_rate>
        <!-- wheels -->
        <left_joint>left_wheel_joint</left_joint>
        <right_joint>right_wheel_joint</right_joint>
        <wheel_separation>0.287</wheel_separation>
        <wheel_radius>0.033</wheel_radius>
      
        <!-- limits -->
        <!--max_linear_acceleration>1.0</max_linear_acceleration-->
        <min_velocity>-1.0</min_velocity>
        <max_velocity>1.0</max_velocity>
        <min_acceleration>-1.0</min_acceleration>
        <max_acceleration>1.0</max_acceleration>
      
        <!-- 通信设置 --> 
        <topic>/cmd_vel</topic>
        <odom_topic>/odom</odom_topic> 
        <frame_id>odom</frame_id> 
        <child_frame_id>base_footprint</child_frame_id>
      
        <!--robot_base_frame>base_footprint</robot_base_frame>
        <odom_frame>odom</odom_frame-->
      
        <publish_odom>true</publish_odom>   <!-- 确保发布里程计 -->
        <publish_odom_tf>true</publish_odom_tf>     <!-- 确保发布TF变换 -->
        <publish_wheel_tf>true</publish_wheel_tf> 
        <odometry_frame>/odom</odometry_frame>    <!-- 里程计坐标系 -->
        <robot_base_frame>base_footprint</robot_base_frame> <!-- 机器人基坐标系 -->
        <odometry_source>world</odometry_source> <!-- 里程计数据源 -->
      
        <!-- 发布频率 -->
        <odom_publisher_frequency>30</odom_publisher_frequency> 
      
        <!--tf_topic>/tf</tf_topic> 
        <publish_odom_tf>true</publish_odom_tf>
        <publish_odom>true</publish_odom>
        <odom_publisher_frequency>30</odom_publisher_frequency>
        <publish_wheel_tf>true</publish_wheel_tf> 
        
        <publish_link_pose>true</publish_link_pose>
        <publish_nested_model_pose>false</publish_nested_model_pose-->
        <!-- odom_frame>odom</odom_frame --> 
        <!-- robot_base_frame>base_link</robot_base_frame --> 
      
        <!-- publish_odom>true</publish_odom>
        <publish_wheel_tf>true</publish_wheel_tf -->
      
      </plugin>
      
      <plugin filename="libgz-sim8-joint-state-publisher-system.so" name="gz::sim::systems::JointStatePublisher"> 
        <!--update_rate>30</update_rate -->
        <topic>joint_states</topic> 
        <joint_name>right_wheel_joint</joint_name>
        <joint_name>left_wheel_joint</joint_name>
      </plugin>    
      
      <plugin filename="libgz-sim8-pose-publisher-system.so" name="gz::sim::systems::PosePublisher">
        <publish_model_pose>true</publish_model_pose>
        <update_rate>30</update_rate>
        <topic>/model/fishbot_base/pose</topic>
      </plugin>
      <plugin filename="gz-sim-imu-system" name="gz::sim::systems::Imu">
      </plugin>
      

      </gazebo>

      <!-- ros2_control name="GazeboSystem" type="system">
      <hardware>
      <plugin>gz_ros2_control/GazeboSimROS2ControlHardware</plugin>
      </hardware>
      <joint name="left_wheel_joint">
      <command_interface name="velocity"/>
      <state_interface name="position"/>
      <state_interface name="velocity"/>
      </joint>
      <joint name="right_wheel_joint">
      <command_interface name="velocity"/>
      <state_interface name="position"/>
      <state_interface name="velocity"/>
      </joint>
      </ros2_control -->

      <link name="base_footprint">

      <!-- 这是一个虚拟链接,不需要几何形状 -->
      <inertial>
        <mass value="0.001"/>  <!-- 极小质量 -->
        <inertia ixx="0.000001" ixy="0" ixz="0" iyy="0.000001" iyz="0" izz="0.000001"/>
      </inertial>
      

      </link>

      <joint name="base_footprint_joint" type="fixed">
      <parent link="base_footprint"/>
      <child link="base_link"/>
      <origin xyz="0 0 0.05" rpy="0 0 0"/>
      </joint>

      <!--joint name="base_link_joint" type="fixed">
      <parent link="base_footprint"/>
      <child link="base_link"/>
      <origin xyz="0 0 0.033" rpy="0 0 0"/>
      </joint -->

      <!-- base link -->
      <link name="base_link">
      <visual>
      <origin xyz="0 0 0.0" rpy="0 0 0"/>
      <geometry>
      <cylinder length="0.12" radius="0.10"/>
      </geometry>
      <material name="white">
      <color rgba="1.0 1.0 1.0 0.5 " />
      </material>
      </visual>
      <collision>
      <origin xyz="0 0 0.0" rpy="0 0 0"/>
      <geometry>
      <cylinder length="0.12" radius="0.10"/>
      </geometry>
      <surface>
      <friction>
      <ode>
      <mu>1.0</mu>
      <mu2>1.0</mu2>
      </ode>
      </friction>
      </surface>
      <material name="white">
      <color rgba="1.0 1.0 1.0 0.5 " />
      </material>
      </collision>
      <inertial>
      <mass value="1"/>
      <inertia ixx="0.012" ixy="0" ixz="0" iyy="0.012" iyz="0" izz="0.02"/>
      </inertial>
      <gazebo reference="base_link">
      <turnGravityOff>false</turnGravityOff>
      <dampingFactor>0.1</dampingFactor>
      </gazebo>
      </link>
      <ros>
      <!-- 指定为当前模型发布 TF -->
      <ros2_interface_config>joint_pressure</ros2_interface_config>
      <ros2_interface_config>model_pose</ros2_interface_config>
      <!-- 或者更精细的控制 -->
      <!-- <namespace>/</namespace> -->
      </ros>
      <!-- laser joint -->
      <joint name="laser_joint" type="fixed">
      <parent link="base_link" />
      <child link="laser_link" />
      <origin xyz="0 0 0.075" />
      </joint>

      <!-- laser link -->
      <link name="laser_link">
      <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
      <cylinder length="0.02" radius="0.02"/>
      </geometry>
      <material name="black">
      <color rgba="0.0 0.0 0.0 1.0" />
      </material>
      </visual>
      <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
      <cylinder length="0.02" radius="0.02"/>
      </geometry>
      <material name="black">
      <color rgba="0.0 0.0 0.0 1.0" />
      </material>
      </collision>
      <inertial>
      <mass value="1"/>
      <inertia ixx="0.00019" ixy="0" ixz="0" iyy="0.00019" iyz="0" izz="0.00036"/>
      </inertial>

      <sensor name="hls_lfcd_lds" type="gpu_lidar">
        <always_on>true</always_on>
        <visualize>true</visualize>
        <update_rate>5</update_rate>
        <pose>-0.064 0 0.121 0 0 0</pose>
        <topic>scan</topic>      
        <gz_frame_id>base_scan</gz_frame_id>
        <lidar>
          <scan>
            <horizontal>
              <samples>360</samples>
              <resolution>1.000000</resolution>
              <min_angle>0.000000</min_angle>
              <max_angle>6.280000</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.120000</min>
            <max>3.5</max>
            <resolution>0.015000</resolution>
          </range>
          <noise>
            <type>gaussian</type>
            <mean>0.0</mean>
            <stddev>0.01</stddev>
          </noise>
        </lidar>
      </sensor>
      

      </link>

      <link name="left_wheel_link">
      <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
      <cylinder length="0.04" radius="0.033"/>
      </geometry>
      <material name="wheel_color">
      <color rgba="0.8 0.1 0.1 1.0 " />
      </material>
      </visual>
      <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
      <cylinder length="0.04" radius="0.033"/>
      </geometry>

          <material name="wheel_color">
           	<color rgba="0.8 0.1 0.1 1.0 " /> 
          </material>
          <surface>
            <friction>
              <ode>
                <mu>1.0</mu>  <!-- 摩擦系数 -->
                <mu2>1.0</mu2>
                <kp>1000000.0</kp>
                <kd>100.0</kd>
                <slip1>0.1</slip1>
                <slip2>0.1</slip2>
              </ode>
            </friction>
          </surface>      
        </collision>
        <inertial>
          <mass value="0.5"/>
            <inertia ixx="0.001" ixy="0" ixz="0" iyy="0.001" iyz="0" izz="0.002"/>
          </inertial>
      

      </link>

      <link name="right_wheel_link">
      <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
      <cylinder length="0.04" radius="0.033"/>
      </geometry>
      <material name="wheel_color">
      <color rgba="0.8 0.1 0.1 1.0 " />
      </material>
      </visual>
      <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
      <cylinder length="0.04" radius="0.033"/>
      </geometry>
      <material name="wheel_color">
      <color rgba="0.8 0.1 0.1 1.0 " />
      </material>
      <surface>
      <friction>
      <ode>
      <mu>1.0</mu> <!-- 摩擦系数 -->
      <mu2>1.0</mu2>
      <kp>1000000.0</kp>
      <kd>100.0</kd>
      <slip1>0.1</slip1>
      <slip2>0.1</slip2>
      </ode>
      </friction>
      </surface>

        </collision>
        <inertial>
          <mass value="0.5"/>
            <inertia ixx="0.001" ixy="0" ixz="0" iyy="0.001" iyz="0" izz="0.002"/>
        </inertial>
      

      </link>

      <joint name="left_wheel_joint" type="continuous">
      <parent link="base_link"/>
      <child link="left_wheel_link"/>
      <origin xyz="-0.02 0.144 -0.059" rpy="1.57079 0 0"/>
      <axis xyz="0 0 1"/>
      <limit effort="100" velocity="10.0" lower="-3.14" upper="3.14"/>
      </joint>

      <joint name="right_wheel_joint" type="continuous">
      <parent link="base_link"/>
      <child link="right_wheel_link"/>
      <origin xyz="-0.02 -0.144 -0.059" rpy="1.57079 0 0"/>
      <axis xyz="0 0 1"/>
      <limit effort="100" velocity="10.0" lower="-3.14" upper="3.14"/>
      </joint>

      <link name="imu_link">
      <sensor name="imu_sensor" type="imu">
      <always_on>true</always_on>
      <update_rate>100</update_rate>
      <visualize>true</visualize>
      <topic>imu</topic>
      <imu>
      <angular_velocity>
      <x>
      <noise type="gaussian">
      <mean>0.0</mean>
      <stddev>2e-4</stddev>
      <bias_mean>0.0000075</bias_mean>
      <bias_stddev>0.0000008</bias_stddev>
      </noise>
      </x>
      <y>
      <noise type="gaussian">
      <mean>0.0</mean>
      <stddev>2e-4</stddev>
      <bias_mean>0.0000075</bias_mean>
      <bias_stddev>0.0000008</bias_stddev>
      </noise>
      </y>
      <z>
      <noise type="gaussian">
      <mean>0.0</mean>
      <stddev>2e-4</stddev>
      <bias_mean>0.0000075</bias_mean>
      <bias_stddev>0.0000008</bias_stddev>
      </noise>
      </z>
      </angular_velocity>
      <linear_acceleration>
      <x>
      <noise type="gaussian">
      <mean>0.0</mean>
      <stddev>1.7e-2</stddev>
      <bias_mean>0.1</bias_mean>
      <bias_stddev>0.001</bias_stddev>
      </noise>
      </x>
      <y>
      <noise type="gaussian">
      <mean>0.0</mean>
      <stddev>1.7e-2</stddev>
      <bias_mean>0.1</bias_mean>
      <bias_stddev>0.001</bias_stddev>
      </noise>
      </y>
      <z>
      <noise type="gaussian">
      <mean>0.0</mean>
      <stddev>1.7e-2</stddev>
      <bias_mean>0.1</bias_mean>
      <bias_stddev>0.001</bias_stddev>
      </noise>
      </z>
      </linear_acceleration>
      </imu>
      </sensor>

      <visual>
        <origin xyz="0 0 0.0" rpy="0 0 0"/>
        <geometry>
      	    <box size="0.02 0.02 0.02"/>
        </geometry>
      </visual>
      <collision>
        <origin xyz="0 0 0.0" rpy="0 0 0"/>
        <geometry>
      	    <box size="0.02 0.02 0.02"/>
        </geometry>
      </collision>
      <inertial>
        <mass value="1"/>
          <inertia ixx="0.00019" ixy="0" ixz="0" iyy="0.00019" iyz="0" izz="0.00036"/>
        </inertial>
      

      </link>

      <!-- imu joint -->
      <joint name="imu_joint" type="fixed">
      <parent link="base_link" />
      <child link="imu_link" />
      <origin xyz="0 0 0.02" />
      </joint>

      <link name="caster_link">
      <visual>
      <origin xyz="0 0 0" rpy="1.57079 0 0"/>
      <geometry>
      <sphere radius="0.016"/>
      </geometry>
      <material name="black">
      <color rgba="0.0 0.0 0.0 1.0" />
      </material>
      </visual>
      <collision>
      <origin xyz="0 0 0" rpy="1.57079 0 0"/>
      <geometry>
      <sphere radius="0.016"/>
      </geometry>
      <material name="black">
      <color rgba="0.0 0.0 0.0 1.0" />
      </material>
      </collision>
      <inertial>
      <mass value="1"/>
      <inertia ixx="0.00019" ixy="0" ixz="0" iyy="0.0001904" iyz="0" izz="0.00036"/>
      </inertial>
      </link>

      <joint name="caster_joint" type="fixed">
      <parent link="base_link" />
      <child link="caster_link" />
      <origin xyz="0.06 0.0 -0.076" />
      <axis xyz="0 1 0" />
      </joint>

      <gazebo reference="caster_link">
      <material>Gazebo/Black</material>
      <mu1 value="1.0"/>
      <mu2 value="1.0"/>
      <kp value="1000000.0" />
      <kd value="100.0" />
      <!-- <fdir1 value="0 0 1"/> -->
      </gazebo>

      </robot>
      问题出在哪里?如何修改?

      6 1 条回复 最后回复 回复 引用 0
      • 6
        623934457 @623934457
        最后由 编辑

        @小鱼 请在百忙中看看,谢谢!

        1 条回复 最后回复 回复 引用 0
        • 第一个帖子
          最后一个帖子
        皖ICP备16016415号-7
        Powered by NodeBB | 鱼香ROS