ROS--URDF集成Gazebo仿真小车和rviz结合

2023-05-16

ROS–URDF集成Gazebo仿真小车
实现流程:

需要编写封装惯性矩阵算法的 xacro 文件

为机器人模型中的每一个 link 添加 collision 和 inertial 标签,并且重置颜色属性

在 launch 文件中启动 gazebo 并添加机器人模型

添加辅助运行包

gazebo_plugins  gazebo_ros  gazebo_ros_control  urdf  xacro  

工作目录

在这里插入图片描述

1.编写封装惯性矩阵算法的 head.xacro 文件

<robot name="base" xmlns:xacro="http://wiki.ros.org/xacro">
    <!-- Macro for inertia matrix -->
    <xacro:macro name="sphere_inertial_matrix" params="m r">
        <inertial>
            <mass value="${m}" />
            <inertia ixx="${2*m*r*r/5}" ixy="0" ixz="0"
                iyy="${2*m*r*r/5}" iyz="0" 
                izz="${2*m*r*r/5}" />
        </inertial>
    </xacro:macro>

    <xacro:macro name="cylinder_inertial_matrix" params="m r h">
        <inertial>
            <mass value="${m}" />
            <inertia ixx="${m*(3*r*r+h*h)/12}" ixy = "0" ixz = "0"
                iyy="${m*(3*r*r+h*h)/12}" iyz = "0"
                izz="${m*r*r/2}" /> 
        </inertial>
    </xacro:macro>

    <xacro:macro name="Box_inertial_matrix" params="m l w h">
       <inertial>
               <mass value="${m}" />
               <inertia ixx="${m*(h*h + l*l)/12}" ixy = "0" ixz = "0"
                   iyy="${m*(w*w + l*l)/12}" iyz= "0"
                   izz="${m*(w*w + h*h)/12}" />
       </inertial>
   </xacro:macro>
</robot>

2.底盘 :semo02_date.urdf.xacro 文件

<!--
    使用 xacro 优化 URDF 版的小车底盘实现:

    实现思路:
    1.将一些常量、变量封装为 xacro:property
      比如:PI 值、小车底盘半径、离地间距、车轮半径、宽度 ....
    2.使用 宏 封装驱动轮以及支撑轮实现,调用相关宏生成驱动轮与支撑轮

-->
<!-- 根标签,必须声明 xmlns:xacro -->
<robot name="my_base" xmlns:xacro="http://www.ros.org/wiki/xacro">
    <!-- 封装变量、常量 -->
    <!-- PI 值设置精度需要高一些,否则后续车轮翻转量计算时,可能会出现肉眼不能察觉的车轮倾斜,从而导致模型抖动 -->
    <xacro:property name="PI" value="3.1415926"/>
    <!--:黑色设置 -->
    <material name="black">
        <color rgba="0.0 0.0 0.0 1.0" />
    </material>
    <!-- 底盘属性 -->
    <xacro:property name="base_footprint_radius" value="0.001" /> <!-- base_footprint 半径  -->
    <xacro:property name="base_link_radius" value="0.1" /> <!-- base_link 半径 -->
    <xacro:property name="base_link_length" value="0.08" /> <!-- base_link 长 -->
    <xacro:property name="earth_space" value="0.015" /> <!-- 离地间距 -->
    <xacro:property name="base_link_m" value="0.5" /> <!-- 质量  -->

    <!-- 底盘 -->
    <link name="base_footprint">
      <visual>
        <geometry>
          <sphere radius="${base_footprint_radius}" />
        </geometry>
      </visual>
    </link>

    <link name="base_link">
      <visual>
        <geometry>
          <cylinder radius="${base_link_radius}" length="${base_link_length}" />
        </geometry>
        <origin xyz="0 0 0" rpy="0 0 0" />
        <material name="yellow">
          <color rgba="0.5 0.3 0.0 0.5" />
        </material>
      </visual>
      <collision>
        <geometry>
          <cylinder radius="${base_link_radius}" length="${base_link_length}" />
        </geometry>
        <origin xyz="0 0 0" rpy="0 0 0" />
      </collision>
      <xacro:cylinder_inertial_matrix m="${base_link_m}" r="${base_link_radius}" h="${base_link_length}" />

    </link>


    <joint name="base_link2base_footprint" type="fixed">
      <parent link="base_footprint" />
      <child link="base_link" />
      <origin xyz="0 0 ${earth_space + base_link_length / 2 }" />
    </joint>
    <gazebo reference="base_link">
        <material>Gazebo/Yellow</material>
    </gazebo>

    <!-- 驱动轮 -->
    <!-- 驱动轮属性 -->
    <xacro:property name="wheel_radius" value="0.0325" /><!-- 半径 -->
    <xacro:property name="wheel_length" value="0.015" /><!-- 宽度 -->
    <xacro:property name="wheel_m" value="0.05" /> <!-- 质量  -->

    <!-- 驱动轮宏实现 -->
    <xacro:macro name="add_wheels" params="name flag">
      <link name="${name}_wheel">
        <visual>
          <geometry>
            <cylinder radius="${wheel_radius}" length="${wheel_length}" />
          </geometry>
          <origin xyz="0.0 0.0 0.0" rpy="${PI / 2} 0.0 0.0" />
          <material name="black" />
        </visual>
        <collision>
          <geometry>
            <cylinder radius="${wheel_radius}" length="${wheel_length}" />
          </geometry>
          <origin xyz="0.0 0.0 0.0" rpy="${PI / 2} 0.0 0.0" />
        </collision>
        <xacro:cylinder_inertial_matrix m="${wheel_m}" r="${wheel_radius}" h="${wheel_length}" />

      </link>

      <joint name="${name}_wheel2base_link" type="continuous">
        <parent link="base_link" />
        <child link="${name}_wheel" />
        <origin xyz="0 ${flag * base_link_radius} ${-(earth_space + base_link_length / 2 - wheel_radius) }" />
        <axis xyz="0 1 0" />
      </joint>

      <gazebo reference="${name}_wheel">
        <material>Gazebo/Red</material>
      </gazebo>

    </xacro:macro>
    <xacro:add_wheels name="left" flag="1" />
    <xacro:add_wheels name="right" flag="-1" />
    <!-- 支撑轮 -->
    <!-- 支撑轮属性 -->
    <xacro:property name="support_wheel_radius" value="0.0075" /> <!-- 支撑轮半径 -->
    <xacro:property name="support_wheel_m" value="0.03" /> <!-- 质量  -->

    <!-- 支撑轮宏 -->
    <xacro:macro name="add_support_wheel" params="name flag" >
      <link name="${name}_wheel">
        <visual>
            <geometry>
                <sphere radius="${support_wheel_radius}" />
            </geometry>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <material name="black" />
        </visual>
        <collision>
            <geometry>
                <sphere radius="${support_wheel_radius}" />
            </geometry>
            <origin xyz="0 0 0" rpy="0 0 0" />
        </collision>
        <xacro:sphere_inertial_matrix m="${support_wheel_m}" r="${support_wheel_radius}" />
      </link>

      <joint name="${name}_wheel2base_link" type="continuous">
          <parent link="base_link" />
          <child link="${name}_wheel" />
          <origin xyz="${flag * (base_link_radius - support_wheel_radius)} 0 ${-(base_link_length / 2 + earth_space / 2)}" />
          <axis xyz="1 1 1" />
      </joint>
      <gazebo reference="${name}_wheel">
        <material>Gazebo/Red</material>
      </gazebo>
    </xacro:macro>

    <xacro:add_support_wheel name="front" flag="1" />
    <xacro:add_support_wheel name="back" flag="-1" />


</robot>

3:摄像头::semo03_date.urdf.xacro 文件

<!-- 摄像头相关的 xacro 文件 -->
<robot name="my_camera" xmlns:xacro="http://wiki.ros.org/xacro">
    <!-- 摄像头属性 -->
    <xacro:property name="camera_length" value="0.01" /> <!-- 摄像头长度(x) -->
    <xacro:property name="camera_width" value="0.025" /> <!-- 摄像头宽度(y) -->
    <xacro:property name="camera_height" value="0.025" /> <!-- 摄像头高度(z) -->
    <xacro:property name="camera_x" value="0.08" /> <!-- 摄像头安装的x坐标 -->
    <xacro:property name="camera_y" value="0.0" /> <!-- 摄像头安装的y坐标 -->
    <xacro:property name="camera_z" value="${base_link_length / 2 + camera_height / 2}" /> <!-- 摄像头安装的z坐标:底盘高度 / 2 + 摄像头高度 / 2  -->

    <xacro:property name="camera_m" value="0.01" /> <!-- 摄像头质量 -->

    <!-- 摄像头关节以及link -->
    <link name="camera">
        <visual>
            <geometry>
                <box size="${camera_length} ${camera_width} ${camera_height}" />
            </geometry>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
            <material name="black" />
        </visual>
        <collision>
            <geometry>
                <box size="${camera_length} ${camera_width} ${camera_height}" />
            </geometry>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
        </collision>
        <xacro:Box_inertial_matrix m="${camera_m}" l="${camera_length}" w="${camera_width}" h="${camera_height}" />
    </link>

    <joint name="camera2base_link" type="fixed">
        <parent link="base_link" />
        <child link="camera" />
        <origin xyz="${camera_x} ${camera_y} ${camera_z}" />
    </joint>
    <gazebo reference="camera">
        <material>Gazebo/Blue</material>
    </gazebo>
</robot>

4:雷达:semo_04_date.urdf.xacro文件

<!--
    小车底盘添加雷达
-->
<robot name="my_laser" xmlns:xacro="http://wiki.ros.org/xacro">

    <!-- 雷达支架 -->
    <xacro:property name="support_length" value="0.15" /> <!-- 支架长度 -->
    <xacro:property name="support_radius" value="0.01" /> <!-- 支架半径 -->
    <xacro:property name="support_x" value="0.0" /> <!-- 支架安装的x坐标 -->
    <xacro:property name="support_y" value="0.0" /> <!-- 支架安装的y坐标 -->
    <xacro:property name="support_z" value="${base_link_length / 2 + support_length / 2}" /> <!-- 支架安装的z坐标:底盘高度 / 2 + 支架高度 / 2  -->

    <xacro:property name="support_m" value="0.02" /> <!-- 支架质量 -->

    <link name="support">
        <visual>
            <geometry>
                <cylinder radius="${support_radius}" length="${support_length}" />
            </geometry>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
            <material name="red">
                <color rgba="0.8 0.2 0.0 0.8" />
            </material>
        </visual>

        <collision>
            <geometry>
                <cylinder radius="${support_radius}" length="${support_length}" />
            </geometry>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
        </collision>

        <xacro:cylinder_inertial_matrix m="${support_m}" r="${support_radius}" h="${support_length}" />

    </link>

    <joint name="support2base_link" type="fixed">
        <parent link="base_link" />
        <child link="support" />
        <origin xyz="${support_x} ${support_y} ${support_z}" />
    </joint>

    <gazebo reference="support">
        <material>Gazebo/White</material>
    </gazebo>

    <!-- 雷达属性 -->
    <xacro:property name="laser_length" value="0.05" /> <!-- 雷达长度 -->
    <xacro:property name="laser_radius" value="0.03" /> <!-- 雷达半径 -->
    <xacro:property name="laser_x" value="0.0" /> <!-- 雷达安装的x坐标 -->
    <xacro:property name="laser_y" value="0.0" /> <!-- 雷达安装的y坐标 -->
    <xacro:property name="laser_z" value="${support_length / 2 + laser_length / 2}" /> <!-- 雷达安装的z坐标:支架高度 / 2 + 雷达高度 / 2  -->

    <xacro:property name="laser_m" value="0.1" /> <!-- 雷达质量 -->

    <!-- 雷达关节以及link -->
    <link name="laser">
        <visual>
            <geometry>
                <cylinder radius="${laser_radius}" length="${laser_length}" />
            </geometry>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
            <material name="black" />
        </visual>
        <collision>
            <geometry>
                <cylinder radius="${laser_radius}" length="${laser_length}" />
            </geometry>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
        </collision>
        <xacro:cylinder_inertial_matrix m="${laser_m}" r="${laser_radius}" h="${laser_length}" />
    </link>

    <joint name="laser2support" type="fixed">
        <parent link="support" />
        <child link="laser" />
        <origin xyz="${laser_x} ${laser_y} ${laser_z}" />
    </joint>
    <gazebo reference="laser">
        <material>Gazebo/Black</material>
    </gazebo>
</robot>

5:创建运动控制实现系统:move.xacro

<robot name="my_car_move" xmlns:xacro="http://wiki.ros.org/xacro">

    <!-- 传动实现:用于连接控制器与关节 -->
    <xacro:macro name="joint_trans" params="joint_name">
        <!-- Transmission is important to link the joints and the controller -->
        <transmission name="${joint_name}_trans">
            <type>transmission_interface/SimpleTransmission</type>
            <joint name="${joint_name}">
                <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
            </joint>
            <actuator name="${joint_name}_motor">
                <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
                <mechanicalReduction>1</mechanicalReduction>
            </actuator>
        </transmission>
    </xacro:macro>

    <!-- 每一个驱动轮都需要配置传动装置 -->
    <xacro:joint_trans joint_name="left_wheel2base_link" />
    <xacro:joint_trans joint_name="right_wheel2base_link" />

    <!-- 控制器 -->
    <gazebo>
        <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
            <rosDebugLevel>Debug</rosDebugLevel>
            <publishWheelTF>true</publishWheelTF>
            <robotNamespace>/</robotNamespace>
            <publishTf>1</publishTf>
            <publishWheelJointState>true</publishWheelJointState>
            <alwaysOn>true</alwaysOn>
            <updateRate>100.0</updateRate>
            <legacyMode>true</legacyMode>
            <leftJoint>left_wheel2base_link</leftJoint> <!-- 左轮 -->
            <rightJoint>right_wheel2base_link</rightJoint> <!-- 右轮 -->
            <wheelSeparation>${base_link_radius * 2}</wheelSeparation> <!-- 车轮间距 -->
            <wheelDiameter>${wheel_radius * 2}</wheelDiameter> <!-- 车轮直径 -->
            <broadcastTF>1</broadcastTF>
            <wheelTorque>30</wheelTorque>
            <wheelAcceleration>1.8</wheelAcceleration>
            <commandTopic>cmd_vel</commandTopic> <!-- 运动控制话题 -->
            <odometryFrame>odom</odometryFrame> <!-- 里程计坐标系 -->
            <odometryTopic>odom</odometryTopic> <!-- 里程计话题 -->
            <robotBaseFrame>base_footprint</robotBaseFrame> <!-- 根坐标系 -->
        </plugin>
    </gazebo>

</robot>

6:组合底盘、摄像头与雷达的 car.urdf.xacro 文件

<!-- 组合小车底盘与摄像头与雷达 -->
<robot name="my_car_camera" xmlns:xacro="http://wiki.ros.org/xacro">
    <xacro:include filename="head.xacro" />
    <xacro:include filename="semo02_date.urdf.xacro" />
    <xacro:include filename="semo03_date.urdf.xacro" />
    <xacro:include filename="semo_04_date.urdf.xacro" />
<!-- 运动控制 -->
    <xacro:include filename="gazebo/move.xacro" />
</robot>

7:创建demo_03.launch文件

<launch>

    <!-- 将 Urdf 文件的内容加载到参数服务器 -->
    <param name="robot_description" command="$(find xacro)/xacro  $(find urdf02_gazebo)/urdf/xacro/car.urdf.xacro" />

    <!-- 启动 gazebo -->
    <include file="$(find gazebo_ros)/launch/empty_world.launch" >
        <arg name="world_name" value="$(find urdf02_gazebo)/worlds/box_house.world"/>
    </include>

    <!-- 在 gazebo 中显示机器人模型 -->
    <node pkg="gazebo_ros" type="spawn_model" name="model" args="-urdf -model mycar -param robot_description"  />
</launch>

8:下载box_house.world文件

下载地址:https://github.com/zx595306686/sim_demo

9:创建rviz控制demo_04_sens.launch

<launch>
   
    <node pkg="rviz" type="rviz" name="rviz" args="-d $(find urdlee)/config/showmycar.rviz" />
    <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher" output="screen" />
    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen" />
   

</launch>

命令运行

source ./devel/setup.bash
roslaunch urdf02_gazebo demo_03.launch 
roslaunch urdf02_gazebo demo_04_sens.launch
rosrun teleop_twist_keyboard teleop_twist_keyboard.py 

在这里插入图片描述

雷达信息仿真以及显示创建一个:laser.xacro文件

<robot name="my_sensors" xmlns:xacro="http://wiki.ros.org/xacro">

  <!-- 雷达,laser雷达连杆的名称 -->
  <gazebo reference="laser">
   <!-- ray:雷达的类型,rplidar:雷达名字 -->
    <sensor type="ray" name="rplidar">
    <!-- xyz,偏移量,后面是欧拉角 -->
      <pose>0 0 0 0 0 0</pose>
      <!-- 在gazebo中   是否显示雷达射线 -->
      <visualize>true</visualize>

      <!-- 在gazebo中是雷达射线 中更新的频率-->
      <update_rate>5.5</update_rate>
      <ray>
        <scan>
        <!-- 雷达参数-->
          <horizontal>
            <!-- 雷达旋转一周会发射360个点-->
            <samples>360</samples>
            <!-- 雷达分辨率-->
            <resolution>1</resolution>

            <!-- 参数是弧度,采样的角度-->
            <min_angle>-3</min_angle>
            <max_angle>3</max_angle>
          </horizontal>
        </scan>
        <range>
        <!-- 采样的距离-->
          <min>0.10</min>
          <max>30.0</max>
          <resolution>0.01</resolution>
        </range>
        <noise>
        <!-- 高斯噪音-->
          <type>gaussian</type>
          <mean>0.0</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>
      <plugin name="gazebo_rplidar" filename="libgazebo_ros_laser.so">
          <!-- 雷达发布消息的scan -->
        <topicName>/scan</topicName>
        <frameName>laser</frameName>
      </plugin>
    </sensor>
  </gazebo>

</robot>

在car.urdf.xacro中添加雷达模块

<!-- 雷达 -->
<xacro:include filename="gazebo/laser.xacro" />

在这里插入图片描述

在这里插入图片描述

摄像头信息仿真以及显示创建一个:camera.xacro文件

<robot name="my_sensors" xmlns:xacro="http://wiki.ros.org/xacro">
  <!-- 被引用的link -->
  <gazebo reference="camera">
    <!-- 类型设置为 camara -->
    <sensor type="camera" name="camera_node">
      <update_rate>30.0</update_rate> <!-- 更新频率 -->
      <!-- 摄像头基本信息设置 -->
      <camera name="head">
        <horizontal_fov>1.3962634</horizontal_fov>
        <image>
        <!-- 摄像头的分辨率 -->
          <width>1280</width>
          <height>720</height>
          <format>R8G8B8</format>
        </image>
        <clip>
        <!-- 摄像头的观察最近最远距离 -->
          <near>0.02</near>
          <far>300</far>
        </clip>
        <noise>
        <!-- 高斯噪音 -->
          <type>gaussian</type>
          <mean>0.0</mean>
          <stddev>0.007</stddev>
        </noise>
      </camera>
      <!-- 核心插件 -->
      <plugin name="gazebo_camera" filename="libgazebo_ros_camera.so">
        <alwaysOn>true</alwaysOn>
        <updateRate>0.0</updateRate>
        <cameraName>/camera</cameraName>

        <!-- 摄像头显示话题 -->
        <imageTopicName>image_raw</imageTopicName>
        <cameraInfoTopicName>camera_info</cameraInfoTopicName>
        <frameName>camera</frameName>
        <hackBaseline>0.07</hackBaseline>
        <distortionK1>0.0</distortionK1>
        <distortionK2>0.0</distortionK2>
        <distortionK3>0.0</distortionK3>
        <distortionT1>0.0</distortionT1>
        <distortionT2>0.0</distortionT2>
      </plugin>
    </sensor>
  </gazebo>
</robot>

在car.urdf.xacro中添加相机模块

<!-- 摄像头 -->
    <xacro:include filename="gazebo/camera.xacro" />

在这里插入图片描述

在这里插入图片描述

深度相机信息仿真以及显示:kinect.xacro

<robot name="my_sensors" xmlns:xacro="http://wiki.ros.org/xacro">
    <gazebo reference="support">  
      <sensor type="depth" name="camera">
        <always_on>true</always_on>

        <!-- 更新频率 -->
        <update_rate>20.0</update_rate>
        <camera>
          <horizontal_fov>${60.0*PI/180.0}</horizontal_fov>
          <image>
          <!-- 深度相机的分辨率 -->
            <format>R8G8B8</format>
            <width>640</width>
            <height>480</height>
          </image>
          <clip>
          <!-- 深度相机的最近最远距离 -->
            <near>0.05</near>
            <far>8.0</far>
          </clip>
        </camera>
        <plugin name="kinect_camera_controller" filename="libgazebo_ros_openni_kinect.so">

        <!-- 深度相机的命名空间,下面有话题,都已camera为前缀 -->
          <cameraName>camera</cameraName>
          <alwaysOn>true</alwaysOn>
          <updateRate>10</updateRate>

          <!-- 深度相机的话题事件:image_raw:采集一般图像 -->
          <imageTopicName>rgb/image_raw</imageTopicName>
          <!-- 深度相机的话题事件:depth/image_raw和depth/points:采集深度 -->
          <depthImageTopicName>depth/image_raw</depthImageTopicName>
          <pointCloudTopicName>depth/points</pointCloudTopicName>
          <cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
          <depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
          <frameName>support_depth</frameName>
          <baseline>0.1</baseline>
          <distortion_k1>0.0</distortion_k1>
          <distortion_k2>0.0</distortion_k2>
          <distortion_k3>0.0</distortion_k3>
          <distortion_t1>0.0</distortion_t1>
          <distortion_t2>0.0</distortion_t2>
          <pointCloudCutoff>0.4</pointCloudCutoff>
        </plugin>
      </sensor>
    </gazebo>

</robot>

在car.urdf.xacro中添加深度相机模块

<!-- 深度摄像头 -->
    <xacro:include filename="gazebo/kinect.xacro" />

在demo_04_sens.launch中增加

 <!--添加点云坐标系到Kinect连杆坐标系的变换-->
    <node pkg="tf2_ros" type="static_transform_publisher" name="static_transform_publisher" args="0 0 0 -1.57 0 -1.57 /support /support_depth" />

在这里插入图片描述
在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ROS--URDF集成Gazebo仿真小车和rviz结合 的相关文章

  • ROS multi-master——multimaster_fkie配置

    多主站ROS配置和mutimaster fkie ROS版本 kinetic 操作系统 Ubuntu 16 04 multimaster fkie github 1网络配置 1 1路由器 设置无线路由器并连接两台计算机 机器人 为这两台计算
  • Python 实现 Dijkstar 路径规划算法

    Dijstar 最短路径算法 用于计算起始点到最终点的最短路径 一般采用的是贪心算法策略 原理可以参考 图解 Open list 和 close list 环境 Terminal 需要预先安装两个库 matplotlib 和 math pi
  • 无人驾驶论坛

    1 百度Apollo论坛 http www 51apollo com 2 人工智能中文资讯网 http www ailab cn
  • V-REP安装

    小知识 是当前目录 是父级目录 是根目录 1 下载V REP 官网地址 http www v rep eu downloads html 我用ubuntu16 04下载V REP PRO EDU V3 5 0 Linux tar 2 解压安
  • 关于相机与激光雷达数据采集与标定

    最近在做一个关于车路协同的项目 需要做一个路侧系统 传感器有摄像头和激光雷达 相机和激光雷达联合标定费了老半天劲 在此记录一下 雷达时间戳不对 导致摄像头和雷达的数据无法对齐 解决办法 修改雷达驱动发布点云消息时的时间戳 相机内参标定可以使
  • ROS2踩坑记录

    Vscode 显示 找不到module 以此选择 设置 Python 在setting json中编辑 在 python autoComplete extraPaths 中添加额外的第三方库路径 如 opt ros foxy lib pyt
  • ROS 笔记(01)— Ubuntu 20.04 ROS 环境搭建

    ROS 官网 https www ros org ROS 中文官网 http wiki ros org cn 1 系统和 ROS 版本 不同的 ROS 版本所需的 ubuntu 版本不同 每一版 ROS 都有其对应版本的 Ubuntu 切记
  • 最快实现一个自己的扫地机

    作者 良知犹存 转载授权以及围观 欢迎关注微信公众号 羽林君 或者添加作者个人微信 become me 扫地机介绍 扫地机器人行业本质是技术驱动型行业 产品围绕导航系统的升级成为行业发展的主旋律 按功能划分 扫地机器人分为四大系统 即导航系
  • 程序“catkin_init_workspace”尚未安装。 您可以使用以下命令安装: sudo apt install catkin

    程序 catkin init workspace 尚未安装 您可以使用以下命令安装 sudo apt install catkin 问题如图 先贴上解决后的效果 运行环境 ubuntu 16 04 ros版本 kinetic 问题解释 这个
  • 《机器人操作系统入门》课程代码示例安装出错解决方法

    问题描述 学习 机器人操作系统入门 课程时 在Ubuntu 16 04 上安装了kinetic 安装ROS Academy for Beginners时依赖总是报错 如下所示 rosdep install from paths src ig
  • 如何将从 rospy.Subscriber 数据获得的数据输入到变量中?

    我写了一个示例订阅者 我想将从 rospy Subscriber 获得的数据提供给另一个变量 以便稍后在程序中使用它进行处理 目前 我可以看到订阅者正在运行 因为当我使用 rospy loginfo 函数时 我可以看到打印的订阅值 虽然我不
  • 如何将视频或图像序列转换为包文件?

    我是 ROS 新手 我需要转换预先存在的视频文件 或者large可以连接到视频流中的图像数量 bagROS 中的文件 我在网上找到了这段代码 http answers ros org question 11537 creating a ba
  • 如何将曲面拟合到一组数据点并获得曲面方程

    乌班图 ROS 思维 Python程序 我正在尝试获取适合点云数据中的一组点的表面方程 数据来自激光雷达扫描仪 我在 rviz 中选择整个扫描的一部分 并获得该选择的坐标选定表面的图片 所选曲面并不总是如此线性 因为材质中可能存在轻微的曲线
  • 不使用ros编译roscpp(使用g++)

    我正在尝试在不使用ROS其余部分的情况下编译roscpp 我只需要订阅一个节点 但该节点拥有使用旧版本ROS的节点 并且由于编译问题 我无法将我的程序与他的程序集成 我从git下载了源代码 https github com ros ros
  • 在 Ubuntu 18.10 上安装 ROS Melodic

    I can t是唯一对 Cosmic 与 Wayland 和 Melodic 的组合感兴趣的人 我会坦白说 我似乎已经在 XPS 13 9370 上成功管理了此操作 或者至少安装脚本 最终 成功完成 然而 有一个非常棘手的解决方法 无论结果
  • catkin_make 编译报错 Unable to find either executable ‘empy‘ or Python module ‘em‘...

    文章目录 写在前面 一 问题描述 二 解决方法 参考链接 写在前面 自己的测试环境 Ubuntu20 04 一 问题描述 自己安装完 anaconda 后 再次执行 catkin make 遇到如下问题 CMake Error at opt
  • catkin_make 编译报错 Unable to find either executable ‘empy‘ or Python module ‘em‘...

    文章目录 写在前面 一 问题描述 二 解决方法 参考链接 写在前面 自己的测试环境 Ubuntu20 04 一 问题描述 自己安装完 anaconda 后 再次执行 catkin make 遇到如下问题 CMake Error at opt
  • 如何订阅“/scan”主题、修改消息并发布到新主题?

    我想通过订阅message ranges来改进turtlebot3的LDS 01传感器 通过应用一些算法修改messange ranges并将其发布到新主题 如下所示 但是当我运行编码时出现错误 错误是 遇到溢出的情况 错误是 运行时警告
  • 使用 CMake 链接 .s 文件

    我有一个我想使用的 c 函数 但它是用Intel编译器而不是gnu C编译器 我在用着cmake构建程序 我实际上正在使用ROS因此rosmake但基础是cmake所以我认为这更多是一个 cmake 问题而不是ROS问题 假设使用构建的文件
  • ROS中spin和rate.sleep的区别

    我是 ROS 新手 正在尝试了解这个强大的工具 我很困惑spin and rate sleep功能 谁能帮助我了解这两个功能之间的区别以及何时使用每个功能 ros spin and ros spinOnce 负责处理通信事件 例如到达的消息

随机推荐

  • gradle 插件开发踩坑记,应用插件时总是报 UnknownPluginException 异常

    问题描述 引用一个本地开发的 gradle 插件时 xff0c 一直找不到这个插件 ID xff0c 报错 xff1a Caused by org gradle api plugins UnknownPluginException Plug
  • 初学FreeRTOS实现多任务程序

    初学FreeRTOS实现多任务程序 1 什么是FreeRTOS2 STM32下FreeRTOS移植2 1 准备工作2 2 移植更改2 2 1 新建分组2 2 2 添加相应的头文件路径2 2 3 修改 SYSTEM 文件 3 多任务程序的实现
  • 【计网+go】如何获取完整的报文?

    我们想要获取完整的报文 xff0c 首先得知道消息的长度和起始位置然后来读取 通常有以下几种方法 使用带消息头的协议 头部写入包长度 xff0c 然后再读取包内容 设置定长消息 xff0c 每次读取定长内容 xff0c 长度不够时空位补固定
  • Visual Studio 2022下载安装

    Visual Studio 2022下载安装 1 进入官网 官网地址 xff1a https visualstudio microsoft com 这里以Windows操作系统为例 根据需要选择版本 xff0c 我这里下载的是Enterpr
  • Lighttpd入门教程

    Lighttpd入门教程 概述入门教程安装配置静态文件服务动态文件服务 虚拟主机SSL启动服务器日志模块总结lighthttpd使用场景和原理使用场景原理 概述 Lighttpd xff08 也称为轻量级HTTP服务器 xff09 是一款快
  • 5.OSD叠加学习之在YUV图片上显示 竖线横线斜线

    目录 实现效果图 实现思路 xff1a 代码编写 实现效果图 实现思路 xff1a 无论是显示 竖线横线还是斜线 xff0c 无非是对 多个连续的 像素点进行操作 xff0c 明白了一个像素点如何点亮 xff0c 加个循环偏移量 xff0c
  • shell脚本发送http请求

    简述 xff1a 使用shell脚本发送http请求 xff0c 解析请求获取token再次发起请求 系统 xff1a ubuntu系统 工具 xff1a cURL 发送http请求 xff0c jq 解析json xff0c 没有需要安装
  • 2020年电赛省赛题目A——无线运动传感器节点设计

    无线运动传感器节点设计 题目要求设计方案分析心电检测模块方案ADS1292的A D转换计算心电信号的处理体表温度分析计算运动量分析计算无线传输模块设计显示屏的设计电路设计温度模块设计加速度计模块设计无线传输模块设计PCB布线布局 题目要求
  • 【全志T113-S3_100ask】8-USB串口获取GPS数据(含解析)

    全志T113 S3 100ask 8 USB串口获取GPS数据 xff08 含解析 xff09 背景 xff08 一 xff09 USB串口驱动 xff08 二 xff09 驱动加载 xff08 三 xff09 简单读取串口数据 xff08
  • Java ---JVM栈的存储结构与运行原理

    目录 一 栈中存储结构 二 栈运行原理 一 栈中存储结构 1 每个线程都有自己的栈 xff0c 栈中的数据都是以栈帧 Stack Frame 的格式存在 2 在这个线程上正在执行的每个方法都各自对应一个栈帧 3 栈帧是一个内存区块 xff0
  • c++配置opencv环境

    c 43 43 配置opencv环境 环境 xff1a 系统 xff1a win10系统截至20190523版本 opencv版本 xff1a 3 4 6版本 教程 xff1a 1 下载opencv安装包 xff0c 由于4 0 1版本会出
  • Android应用安全解决方案

    前言 防止第三方反编译篡改应用 xff0c 防止数据隐私泄露 xff0c 防止二次打包欺骗用户 1 一些必要的基础知识 我们在加密的时候会用到一些加密或者编码方法 常见的有 xff0c 非对称加密算法 RSA 等 xff1b 对称加密算法
  • win10修改系统配置处理器引导参数后,系统无限蓝屏解决办法

    win10修改系统配置处理器引导参数后 xff0c 系统无限蓝屏解决办法 0 xff1a 开机时先按f8进入安全模式 xff0c 在进入命令提示符 1 进入 启动修复 的 命令提示符 xff08 最好是使用有管理员权限的 xff0c 不过普
  • 运行内存变成的2G,为硬件保留内存为6G

    运行内存变成的2G xff0c 为硬件保留内存为6G 先看设置中下面是否有设置是否激活windows xff0c 如有点进去 xff0c 有疑难解疑下面 xff0c 点入会自动激活windows xff0c 如盗版就不行 xff0c 激活后
  • ubuntu20.4安装NVIDIA驱动,cuda

    安装NVIDIA驱动准备工作 下载NVIDIA地址 xff1a https www nvidia cn Download index aspx lang 61 cn 查看是否安装好驱动命令 xff1a nvidia span class t
  • 图像进行反转:白变黑,黑变白

    图像进行反转 xff1a 白变黑 xff0c 黑变白 二值图对图像进行反转 span class token keyword import span cv2 img span class token operator 61 span spa
  • python调用相机和双目相机

    python调用相机 span class token keyword import span cv2 span class token keyword import span numpy span class token keyword
  • 安装PCL1.9.1其它版本号Python3.6+PCL1.9.1+VS2017+gtkbundle_3.6.4版本

    下载 python pcl文件 地址 xff1a https github com strawlab python pcl 安装 VS2017 安装PLC1 91 首先在自己电脑上安装PCL xff08 点击这里 xff09 xff0c 这
  • ROS--机器人小车仿真rviz

    URDF练习 需求描述 创建一个四轮圆柱状机器人模型 xff0c 机器人参数如下 底盘为圆柱状 xff0c 半径 10cm xff0c 高 8cm xff0c 四轮由两个驱动轮和两个万向支撑轮组成 xff0c 两个驱动轮半径为 3 25cm
  • ROS--URDF集成Gazebo仿真小车和rviz结合

    ROS URDF集成Gazebo仿真小车 实现流程 需要编写封装惯性矩阵算法的 xacro 文件 为机器人模型中的每一个 link 添加 collision 和 inertial 标签 xff0c 并且重置颜色属性 在 launch 文件中