前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ROS1云课→24机器人感知配置

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

作者头像
zhangrelay
发布2022-09-30 15:16:31
2370
发布2022-09-30 15:16:31
举报

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

如上案例已成往事。

接着:

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


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

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

各部件如何组织?

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

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

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

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

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

以如下为例:

代码语言:javascript
复制
roslaunch stdr_launchers server_with_map_and_gui_plus_robot.launch 
... logging to /home/shiyanlou/.ros/log/5c5946bc-310e-11ed-bb49-0242c0a82a03/roslaunch-631c92c680e1117f240d98bc-249.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://631c92c680e1117f240d98bc:34491/

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /
    robot_manager (nodelet/nodelet)
    robot_spawn_631c92c680e1117f240d98bc_249_8562265880368680734 (stdr_robot/robot_handler)
    stdr_gui_node_631c92c680e1117f240d98bc_249_3310443324658540553 (stdr_gui/stdr_gui_node)
    stdr_server (stdr_server/stdr_server_node)
    world2map (tf/static_transform_publisher)

auto-starting new master
process[master]: started with pid [259]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 5c5946bc-310e-11ed-bb49-0242c0a82a03
process[rosout-1]: started with pid [272]
started core service [/rosout]
process[robot_manager-2]: started with pid [275]
process[stdr_server-3]: started with pid [276]
process[world2map-4]: started with pid [277]
process[stdr_gui_node_631c92c680e1117f240d98bc_249_3310443324658540553-5]: started with pid [278]
process[robot_spawn_631c92c680e1117f240d98bc_249_8562265880368680734-6]: started with pid [279]
[ INFO] [1662817327.793693604]: Loading map from image "/opt/ros/kinetic/share/stdr_resources/maps/sparse_obstacles.png"
[ INFO] [1662817327.811476454]: Read a 775 X 746 map @ 0.020 m/cell
[robot_spawn_631c92c680e1117f240d98bc_249_8562265880368680734-6] process has finished cleanly
log file: /home/shiyanlou/.ros/log/5c5946bc-310e-11ed-bb49-0242c0a82a03/robot_spawn_631c92c680e1117f240d98bc_249_8562265880368680734-6*.log

查看各模块tf关系:

rqt-tf


激光传感器数据:

可视化

枯燥数值: 

代码语言:javascript
复制
shiyanlou:~/ $ rosmsg show sensor_msgs/LaserScan                     [21:48:41]
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
float32 angle_min
float32 angle_max
float32 angle_increment
float32 time_increment
float32 scan_time
float32 range_min
float32 range_max
float32[] ranges
float32[] intensities

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

sensor_msgs/LaserScansensor_msgs/PointCloud2


里程计

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

代码语言:javascript
复制
shiyanlou:~/ $ rosmsg show nav_msgs/Odometry                         [21:49:13]
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
string child_frame_id
geometry_msgs/PoseWithCovariance pose
  geometry_msgs/Pose pose
    geometry_msgs/Point position
      float64 x
      float64 y
      float64 z
    geometry_msgs/Quaternion orientation
      float64 x
      float64 y
      float64 z
      float64 w
  float64[36] covariance
geometry_msgs/TwistWithCovariance twist
  geometry_msgs/Twist twist
    geometry_msgs/Vector3 linear
      float64 x
      float64 y
      float64 z
    geometry_msgs/Vector3 angular
      float64 x
      float64 y
      float64 z
  float64[36] covariance

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

代码语言:javascript
复制
shiyanlou:~/ $ rostopic list                                         [21:53:05]
/clicked_point
/initialpose
/map
/map_metadata
/map_updates
/move_base_simple/goal
/robot0/cmd_vel
/robot0/laser_0
/robot0/odom
/robot0/sonar_0
/robot0/sonar_1
/robot0/sonar_2
/robot0/sonar_3
/robot0/sonar_4

/robot0/laser_0 /robot0/odom /robot0/sonar_0 /robot0/sonar_1 /robot0/sonar_2 /robot0/sonar_3 /robot0/sonar_4

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

代码语言:javascript
复制
shiyanlou:~/ $ rostopic type /robot0/sonar_0                         [22:00:13]
sensor_msgs/Range
shiyanlou:~/ $ rosmsg show sensor_msgs/Range                         [22:00:16]
uint8 ULTRASOUND=0
uint8 INFRARED=1
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
uint8 radiation_type
float32 field_of_view
float32 min_range
float32 max_range
float32 range

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

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

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2022-09-10,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档