• ROS1云课→24机器人感知配置


    ROS1云课→23turtlesim绘制小结(数学和编程)

    如上案例已成往事。

    接着:

    ROS1云课→22机器人轨迹跟踪


    以真实和仿真机器人共性知识点展开。

    机器人配置包含哪些模块呢???

    各部件如何组织?

    导航功能包集需要知道传感器、轮轴和关节的位置。

    使用tfTransform Frame)软件库来完成这部分工作。它会管理坐标变换树。也可以使用数学工具来完成这部分工作,但如果需要计算很多的坐标系,那么这就会显得有些复杂和混乱了。

    得益于tf软件库,使得可以向机器人添加更多的传感器和组件,tf会为处理这些设备之间的关系。

    如果将激光雷达向后移动10cm或者向前移动20cm(相对于在base_link坐标系中的原始坐标位置),都需要添加一个带有这些偏移的新坐标系到坐标变换树。

    一旦插入和创建完成,就能轻松地知道激光雷达相对于base_link值或者是相对于轮子的位置。唯一需要做的就是调用tf库并进行坐标变换。

    以如下为例:

    1. roslaunch stdr_launchers server_with_map_and_gui_plus_robot.launch
    2. ... logging to /home/shiyanlou/.ros/log/5c5946bc-310e-11ed-bb49-0242c0a82a03/roslaunch-631c92c680e1117f240d98bc-249.log
    3. Checking log directory for disk usage. This may take awhile.
    4. Press Ctrl-C to interrupt
    5. Done checking log file disk usage. Usage is <1GB.
    6. started roslaunch server http://631c92c680e1117f240d98bc:34491/
    7. SUMMARY
    8. ========
    9. PARAMETERS
    10. * /rosdistro: kinetic
    11. * /rosversion: 1.12.14
    12. NODES
    13. /
    14. robot_manager (nodelet/nodelet)
    15. robot_spawn_631c92c680e1117f240d98bc_249_8562265880368680734 (stdr_robot/robot_handler)
    16. stdr_gui_node_631c92c680e1117f240d98bc_249_3310443324658540553 (stdr_gui/stdr_gui_node)
    17. stdr_server (stdr_server/stdr_server_node)
    18. world2map (tf/static_transform_publisher)
    19. auto-starting new master
    20. process[master]: started with pid [259]
    21. ROS_MASTER_URI=http://localhost:11311
    22. setting /run_id to 5c5946bc-310e-11ed-bb49-0242c0a82a03
    23. process[rosout-1]: started with pid [272]
    24. started core service [/rosout]
    25. process[robot_manager-2]: started with pid [275]
    26. process[stdr_server-3]: started with pid [276]
    27. process[world2map-4]: started with pid [277]
    28. process[stdr_gui_node_631c92c680e1117f240d98bc_249_3310443324658540553-5]: started with pid [278]
    29. process[robot_spawn_631c92c680e1117f240d98bc_249_8562265880368680734-6]: started with pid [279]
    30. [ INFO] [1662817327.793693604]: Loading map from image "/opt/ros/kinetic/share/stdr_resources/maps/sparse_obstacles.png"
    31. [ INFO] [1662817327.811476454]: Read a 775 X 746 map @ 0.020 m/cell
    32. [robot_spawn_631c92c680e1117f240d98bc_249_8562265880368680734-6] process has finished cleanly
    33. log file: /home/shiyanlou/.ros/log/5c5946bc-310e-11ed-bb49-0242c0a82a03/robot_spawn_631c92c680e1117f240d98bc_249_8562265880368680734-6*.log

    查看各模块tf关系:

    rqt-tf

     


    激光传感器数据:

    可视化

     

    枯燥数值: 

    1. shiyanlou:~/ $ rosmsg show sensor_msgs/LaserScan [21:48:41]
    2. std_msgs/Header header
    3. uint32 seq
    4. time stamp
    5. string frame_id
    6. float32 angle_min
    7. float32 angle_max
    8. float32 angle_increment
    9. float32 time_increment
    10. float32 scan_time
    11. float32 range_min
    12. float32 range_max
    13. float32[] ranges
    14. float32[] intensities

    这是感知外部障碍物的重要传感器。初次之外还有点云数据,分别如下:

    sensor_msgs/LaserScansensor_msgs/PointCloud2


    里程计

    导航功能包集还需要获取机器人的里程信息。里程信息指的是机器人相对于某一点的距离。

    1. shiyanlou:~/ $ rosmsg show nav_msgs/Odometry [21:49:13]
    2. std_msgs/Header header
    3. uint32 seq
    4. time stamp
    5. string frame_id
    6. string child_frame_id
    7. geometry_msgs/PoseWithCovariance pose
    8. geometry_msgs/Pose pose
    9. geometry_msgs/Point position
    10. float64 x
    11. float64 y
    12. float64 z
    13. geometry_msgs/Quaternion orientation
    14. float64 x
    15. float64 y
    16. float64 z
    17. float64 w
    18. float64[36] covariance
    19. geometry_msgs/TwistWithCovariance twist
    20. geometry_msgs/Twist twist
    21. geometry_msgs/Vector3 linear
    22. float64 x
    23. float64 y
    24. float64 z
    25. geometry_msgs/Vector3 angular
    26. float64 x
    27. float64 y
    28. float64 z
    29. float64[36] covariance

    这些数据都采用主题方式发布:

    1. shiyanlou:~/ $ rostopic list [21:53:05]
    2. /clicked_point
    3. /initialpose
    4. /map
    5. /map_metadata
    6. /map_updates
    7. /move_base_simple/goal
    8. /robot0/cmd_vel
    9. /robot0/laser_0
    10. /robot0/odom
    11. /robot0/sonar_0
    12. /robot0/sonar_1
    13. /robot0/sonar_2
    14. /robot0/sonar_3
    15. /robot0/sonar_4


    /robot0/laser_0
    /robot0/odom

    /robot0/sonar_0
    /robot0/sonar_1
    /robot0/sonar_2
    /robot0/sonar_3
    /robot0/sonar_4

    还有5个超声波传感器,可以近似理解为单线单点激光雷达

    1. shiyanlou:~/ $ rostopic type /robot0/sonar_0 [22:00:13]
    2. sensor_msgs/Range
    3. shiyanlou:~/ $ rosmsg show sensor_msgs/Range [22:00:16]
    4. uint8 ULTRASOUND=0
    5. uint8 INFRARED=1
    6. std_msgs/Header header
    7. uint32 seq
    8. time stamp
    9. string frame_id
    10. uint8 radiation_type
    11. float32 field_of_view
    12. float32 min_range
    13. float32 max_range
    14. float32 range

    stdr感知配置一般就这样了,三维环境还可以加配各类视觉传感器。

    • 超声波或声纳测距
    • 激光雷达测量
    • 惯性导航设备IMU
    • 视觉设备
    • ……

  • 相关阅读:
    从内存角度聊聊虚函数
    ThreadLocal原理分析
    Anti-C-Myc Antibody (Chicken) - FITC Conjugated
    Intel汇编-内联汇编使用volatile
    内创业革命
    MySQL运维15-一主一从读写分离
    PyIntObject 对象
    PLC面向对象编程系列之如何设计分解状态机(FSM)的状态
    Gotchiverse NFT 游戏公会访谈——8bit Gamers 公会
    SQL优化
  • 原文地址:https://blog.csdn.net/ZhangRelay/article/details/126799932