aubo_i5基于Octomap的避障

该博客介绍了如何在Ubuntu 18.04上使用ROS进行Aubo机械臂的rviz仿真,结合Kinectv2进行手眼标定,并利用Octomap构建静态地图。主要步骤包括修改publish.launch文件,配置aubo_i5_moveit_config,以及设置传感器参数。在过程中,作者遇到了无法采样有效状态的错误,并给出了调整目标位置和方向容忍度的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一.Ubuntu18.04下使用ros进行aubo机械臂rviz仿真

1.参考链接

二.aubo_i5+Kinect v2手眼标定

2.方法

三.基于Octomap静态地图构建

1.修改easy_handeye自带的publish.launch文件

<?xml version="1.0"?>
<launch>
    <arg name="eye_on_hand" doc="eye-on-hand instead of eye-on-base" default="false" />
    <!--arg name="namespace_prefix" default="ur3_kinect_handeyecalibration" /-->
    <arg name="namespace_prefix" default="aubo_i5_kinect_handeyecalibration" />
    <arg if="$(arg eye_on_hand)" name="namespace" value="$(arg namespace_prefix)_eye_on_hand" />
    <arg unless="$(arg eye_on_hand)" name="namespace" value="$(arg namespace_prefix)_eye_on_base" />

    <!--it is possible to override the link names saved in the yaml file in case of name clashes, for example-->
    <arg if="$(arg eye_on_hand)" name="robot_effector_frame" default="" />
    <arg unless="$(arg eye_on_hand)" name="robot_base_frame" default="" />
    <arg name="tracking_base_frame" default="" />
    
    <arg name="inverse" default="false" />
    
    <!--publish hand-eye calibration-->
    <group ns="$(arg namespace)">
        <param name="eye_on_hand" value="$(arg eye_on_hand)" />
        <param unless="$(arg eye_on_hand)" name="robot_base_frame" value="$(arg robot_base_frame)" />
        <param if="$(arg eye_on_hand)" name="robot_effector_frame" value="$(arg robot_effector_frame)" />
        <param name="tracking_base_frame" value="$(arg tracking_base_frame)" />
        <param name="inverse" value="$(arg inverse)" />
        <node name="$(anon handeye_publisher)" pkg="easy_handeye" type="publish.py" output="screen"/>
    </group>
    <!--node pkg="tf" type="static_transform_publisher"  name="link1_broadcaster" args="-0.7111208301957235  0.8221538170167787  0.40000751341893015 -0.19009128487976332 0.7372602181756381 -0.6294715435902674   0.15517167885428526 base camera_link 100 "/-->

    <node pkg="tf" type="static_transform_publisher"  name="link1_broadcaster" args="-0.10855619090526175  -1.57207693625539  0.5927385133279733 -0.7006653080002005 -0.14403069755411202 0.1454984302581171   0.6834862771990992 base camera_link 100 "/>

</launch>

2.编写aubo.luanch

<launch>
	
   <!-- start the robot -->
<include file="$(find aubo_i5_moveit_config)/launch/moveit_planning_execution.launch">
	<arg name="sim" value="false" />
        <arg name="robot_ip" value="192.168.1.135" />
</include>
 
 
  <!-- start the kinect2 -->  
  <include file="$(find kinect2_bridge)/launch/kinect2_bridge.launch" />
  <include file="$(find easy_handeye)/launch/publish.launch" />
</launch>

3.配置aubo_i5_moveit_config/config/sensors_kinect.yaml

  • padding_offset: The size of the padding (in cm).
  • padding_scale: The scale of the padding
# The name of this file shouldn't be changed, or else the Setup Assistant won't detect it
sensors:
  - sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater

    point_cloud_topic: /kinect2/qhd/points

    max_range: 3.0

    point_subsample: 1

    padding_offset: 0.1

    padding_scale: 1.8

    max_update_rate: 1.0

    filtered_cloud_topic: filtered_cloud

4.配置aubo_i5_moveit_config/launch/sensor_manager.launch.xml

<launch>

  <!-- This file makes it easy to include the settings for sensor managers -->

  <!-- Params for 3D sensors config -->
  <rosparam command="load" file="$(find aubo_i5_moveit_config)/config/sensors_3d.yaml" />

  <!-- Params for the octomap monitor -->
  <!--  <param name="octomap_frame" type="string" value="some frame in which the robot moves" /> -->
  <param name="octomap_resolution" type="double" value="0.025" />
  <param name="max_range" type="double" value="5.0" />

  <!-- Load the robot specific sensor manager; this sets the moveit_sensor_manager ROS parameter -->
  <arg name="moveit_sensor_manager" default="aubo_i5" />
  <include file="$(find aubo_i5_moveit_config)/launch/$(arg moveit_sensor_manager)_moveit_sensor_manager.launch.xml" />
  <rosparam command="load" file="$(find aubo_i5_moveit_config)/config/sensors_kinect.yaml" />

  <param name="octomap_frame" type="string" value="odom_combined" />

  <param name="octomap_resolution" type="double" value="0.05" />

  <param name="max_range" type="double" value="5.0" />
</launch>

5.source ~/aubo_ws/devel/setup.sh

    roslaunch aubo.launch

涉及的bug:

1.ERROR: Unable to sample any valid states for goal tree

    解决方法(设置位置的允许误差或者将关节位置小数点后数据去掉):

group.setGoalPositionTolerance(0.01);
group.setGoalOrientationTolerance(0.1);

<think>好的,我现在需要帮助用户搭建一个基于Gazebo的仿真平台,用于验证云深Lite3机器狗搭配速腾RSHelios 32线70度FOV 5515雷达,测试Faster-LIO和OctoMap的可行性。首先,我得理清用户的具体需求和可能的挑战。 用户提到的组件包括Lite3机器狗、RSHelios雷达,以及Faster-LIO和OctoMap。看起来用户可能是在做SLAM相关的研究,特别是激光雷达SLAM和三维环境建模。可行性验证可能涉及在仿真环境中模拟雷达数据,运行算法,评估建图效果和定位精度。 首先,我需要考虑如何在Gazebo中构建这些仿真模型。Lite3机器狗的模型可能已经有现成的URDF或SDF文件,但如果没有,用户需要自己创建或者从DeepRoboticsLab的仓库获取。然后是雷达的仿真,RSHelios 32线的参数需要准确设置,尤其是70度的垂直视场角,可能需要调整Gazebo的激光雷达插件参数。 接下来是Faster-LIO和OctoMap的集成。Faster-LIO作为高效的LiDAR惯性里程计,可能需要IMU数据,所以在仿真中需要确保机器狗的IMU传感器模型输出准确的数据。OctoMap用于三维占据地图,需要点云输入,因此雷达的点云数据需要正确发布到ROS话题。 可能遇到的问题包括雷达仿真数据的噪声模拟是否足够真实,Gazebo和ROS之间的通信延迟是否会影响算法性能,以及URDF模型中传感器坐标系是否正确对齐。此外,Faster-LIO对计算资源要求较高,仿真环境中的实时性可能需要优化。 用户可能没有明确说出的是,他们可能希望在仿真中快速迭代算法参数,而无需在真实硬件上测试,从而节省时间和成本。因此,仿真环境的准确性和高效性对他们来说至关重要。另外,他们可能需要评估在不同环境(如动态障碍物、不同地形)下的算法表现,这需要在Gazebo中设计多种测试场景。 总结步骤的话,应该包括:搭建Lite3和雷达的Gazebo模型,配置传感器插件,集成Faster-LIO和OctoMap的ROS包,设计测试场景,运行仿真并评估结果。同时,用户可能需要编写启动文件和一些配置脚本,来简化测试流程。</think>以下是基于仿真开发经验的详细搭建指南,重点针对 **Lite3机器狗+RSHelios 32线雷达** 的Gazebo仿真验证环境设计: --- ### 一、核心目标验证 1. **Faster-LIO**:验证激光雷达+IMU紧耦合SLAM在动态四足平台上的定位精度与实时性 2. **OctoMap**:验证动态环境下的三维占据栅格地图更新效率与避障可行性 --- ### 二、仿真环境搭建步骤 #### 步骤1:机器人模型与传感器集成 - **Lite3 URDF模型**: - 从 [DeepRoboticsLab/Lite3_Model_Control](https://github.com/DeepRoboticsLab/Lite3_Model_Control) 获取基础模型 - 添加雷达安装位置描述(示例关节定义): ```xml <joint name="lidar_joint" type="fixed"> <parent link="body_link"/> <!-- 假设雷达安装于机身 --> <child link="rshelios_link"/> <origin xyz="0.15 0 0.1" rpy="0 0 0"/> <!-- 调整安装偏移 --> </joint> ``` - **RSHelios 32线雷达仿真**: - 使用 `gazebo_ros_ray_sensor` 插件模拟雷达特性: ```xml <gazebo reference="rshelios_link"> <sensor type="ray" name="lidar"> <pose>0 0 0 0 0 0</pose> <visualize>false</visualize> <update_rate>10</update_rate> <!-- 10Hz扫描 --> <ray> <scan> <horizontal> <samples>2200</samples> <!-- 水平分辨率 --> <resolution>1</resolution> <min_angle>-1.57</min_angle> <!-- 水平FOV 180° --> <max_angle>1.57</max_angle> </horizontal> <vertical> <samples>32</samples> <!-- 32线 --> <resolution>1</resolution> <min_angle>-0.35</min_angle> <!-- 垂直FOV 70° --> <max_angle>0.35</max_angle> </vertical> </scan> <range> <min>0.2</min> <!-- 最小探测距离0.2m --> <max>50</max> <!-- 最大探测距离50m --> <resolution>0.03</resolution> </range> </ray> <plugin name="lidar_plugin" filename="libgazebo_ros_ray_sensor.so"> <ros> <namespace>/</namespace> <remapping>~/out:=scan</remapping> </ros> <output_type>sensor_msgs/PointCloud2</output_type> <frame_name>rshelios_link</frame_name> </plugin> </sensor> </gazebo> ``` #### 步骤2:Gazebo场景设计 - **典型测试场景**(通过.world文件定义): ```xml <world> <!-- 地形 --> <include> <uri>model://rough_terrain</uri> <!-- 崎岖地面测试稳定性 --> </include> <!-- 动态障碍物 --> <model name="moving_box"> <pose>2 0 0.5 0 0 0</pose> <link name="link"> <collision> <geometry> <box> <size>0.5 0.5 1</size> </box> </geometry> </collision> <visual> <geometry> <box> <size>0.5 0.5 1</size> </box> </geometry> </visual> </link> <plugin filename="libgazebo_ros_planar_move.so"> <ros> <namespace>/moving_box</namespace> </ros> <velocity>0.5</velocity> <!-- 障碍物移动速度 --> </plugin> </model> </world> ``` #### 步骤3:算法集成验证 - **Faster-LIO配置要点**: - 修改 `config/velodyne.yaml` 适配雷达参数: ```yaml lidar: scan_line: 32 # 线数 vertical_angle: 70 # 垂直FOV max_range: 50.0 # 最大探测距离 time_offset: 0.0 # 时间同步校准 imu: topic: /imu/data # 确保IMU话题与Gazebo输出一致 ``` - 启动命令: ```bash roslaunch faster_lio mapping_avia.launch ``` - **OctoMap构建验证**: - 使用 `octomap_server` 节点订阅点云: ```bash roslaunch octomap_server octomap_mapping.launch ``` - 关键参数调整(`params.yaml`): ```yaml resolution: 0.05 # 地图分辨率 max_range: 20.0 # 有效探测范围 latch: false # 实时更新模式 ``` --- ### 三、可行性验证指标 | 测试项 | 评估方法 | 合格标准 | |-----------------|-----------------------------------|------------------------------| | 定位漂移 | 闭环路径起点与终点位置误差 | < 0.5m (50m轨迹) | | 地图更新延迟 | 障碍物出现到地图更新的时间差 | < 200ms | | CPU占用率 | `top` 或 `htop` 监控 | Faster-LIO < 50%, Octomap < 30% | | 动态障碍物响应 | 移动障碍物在地图中的消失/出现延迟 | < 3次扫描周期 | --- ### 四、常见问题与调试技巧 1. **点云失真问题**: - **现象**:快速运动时点云拉伸 - **解决**:在雷达插件中启用运动补偿: ```xml <plugin ...> ... <enable_motion_compensation>true</enable_motion_compensation> </plugin> ``` 2. **时间同步问题**: - **现象**:IMU与雷达时间戳不同步导致LIO发散 - **解决**:使用 `message_filters` 进行精确时间同步: ```cpp message_filters::Synchronizer<sync_pol> sync(sync_pol(10), cloud_sub, imu_sub); sync.registerCallback(boost::bind(&callback, _1, _2)); ``` 3. **OctoMap更新滞后**: - **调整策略**:降低 `octomap_server` 的 `max_range` 并启用多分辨率更新: ```yaml use_height_map: true filter_ground: false # 四足机器人需保留地面点 ``` --- ### 五、性能优化建议 - **Gazebo加速**: ```bash gazebo --verbose -s libgazebo_ros_paths_plugin.so --disable-rendering ``` - **Faster-LIO加速**: 在 `CMakeLists.txt` 中启用NEON指令: ```cmake add_definitions(-march=native -O3) ``` 通过上述步骤,可系统验证该传感器组合在动态四足平台上的SLAM与建图性能。建议先用简单静态场景验证基础功能,再逐步增加动态障碍物与复杂地形。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值