YdLidar

YdLidar

运行官方例程ydlidar_sample

增加当前用户的操作权限

将YdLidar插入USB口后,会在/dev/目录下生成/dev/ttyUSB0文件(也可能为/dev/ttyUSB1,/dev/ttyUSB2...),
查看此文件

ls -l /dev/ttyUSB0

输出为:

crw-rw---- 1 root dialout 188 , ttyUSB0

c说明表明设备为字符设备文件(d表示目录文件,-表示普通文件,l表示链接文件,b表示块文件),
其中rw-rw----表示root用户作为文件所有者可以读和写,dialout用户组内的用户可以读和写,其他用户不允许读、写和执行(r表示可读,w表示可写,x表示可执行)
因此,需要将当前用户增加到dialout用户组中

sudo usermod -a -G dialout yottayuan

构建ydlidar_sample程序

进入isaacSDK\packages\ydlidar\apps目录下执行:

bazel build ydlidar_sample

运行ydlidar_sample程序

进入isaacSDK\packages\ydlidar\apps目录下执行:

bazel run ydlidar_sample

packages/ydlidar/apps/BUILD

查看BUILD文件,可知,程序引用了ydlidar组件

load("//engine/build:isaac.bzl", "isaac_app")

isaac_app(
    name = "ydlidar_sample",
    modules = [
        "ydlidar",
    ],
)

packages/ydlidar/apps/

{
  "name": "ydlidar_sample",
  "modules": [
    "ydlidar"
  ],
  "config": {
    "lidar": {
      "yd_lidar_driver": {
        "device": "/dev/ttyUSB0"
      }
    },
    "websight": {
      "WebsightServer": {
        "ui_config": {
          "windows": {
            "YDLidar: Samples Per Tick": {
              "renderer": "plot",
              "dims": {
                "width": 1024,
                "height": 200
              },
              "channels": [
                { "name" : "ydlidar_sample/ydlidar/driver/samples_count" },
                { "name" : "ydlidar_sample/ydlidar/driver/arc_measured" }
              ]
            }
          }
        }
      }
    }
  },
  "graph": {
    "nodes": [
      {
        "name": "ydlidar",
        "components": [
          {
            "name": "message_ledger",
            "type": "isaac::alice::MessageLedger"
          },
          {
            "name": "driver",
            "type": "isaac::ydlidar::YdLidar"
          }
        ]
      }
    ],
    "edges": [
    ]
  }
}

isaac.ydlidar.YdLidar

Description

YDLidar X4 is alow cost LIDAR that is popular with hobbyist.

Type: Codelet - This component ticks either periodically or when it receives messages.

Incoming messages

(none)

Outgoing messages

  • flatscan [FlatscanProto]: A flat scan from the LIDAR Average message covers about 0.4 radians and contains 40 measurements Average message publish rate is 120 messages per second

Parameters

  • device [string] [default=”/dev/ttyUSB0”]: Serial port where device is connected

FlatscanProto

# A 2D range scan which is essentially a flat version of the 3D RangeScanProto
struct FlatscanProto {
  # Angles (in radians) under which rays are shot
  angles @0: List(Float32);
  # Return distance of the ray
  ranges @1: List(Float32);
  # Beams with a range smaller than or equal to this distance are considered to have returned an
  # invalid measurement.
  invalidRangeThreshold @2: Float64;
  # Beams with a range larger than or equal to this distance are considered to not have hit an
  # obstacle within the maximum possible range of the sensor.
  outOfRangeThreshold @3: Float64;
  # Return the visibility of a given ray (the longest valid distance of a beams in this direction)
  # This field is optional, however if it is set, it must have the same size as ranges and angles.
  visibilities @4: List(Float32);
}

isaac.flatsim.SimRangeScan

Description

Simulates a 2D range scan

Type: Codelet - This component ticks either periodically or when it receives messages.

Incoming messages

(none)

Outgoing messages

  • flatscan [FlatscanProto]: Output a FlatScan proto: this is a list of beams (angle + distance)

Parameters

  • num_beams [int] [default=360]: The number of beams in the range scan
  • min_range [double] [default=0.25]: The minimum range at which obstacles are detected
  • max_range [double] [default=50.0]: The maximum range of the simulated LIDAR
  • min_angle [double] [default=0.0]: The min angle of simulated beams
  • max_angle [double] [default=TwoPi<double>]: The max angle of simulated beams
  • map [string] [default=”map”]: Map node to use for tracing range scans

isaac.lidar_slam.GMapping

Description

This component wraps the GMapping LIDAR SLAM library for ISAAC SDK. You can learn more about GMapping on their webpage: https://openslam-org.github.io/gmapping.html. Please note that GMapping is an experimental library and that results may vary depending on the LIDAR you are using or the environment you are trying to map.

Type: Codelet - This component ticks either periodically or when it receives messages.

Incoming messages

  • flatscan [FlatscanProto]: GMapping uses a 2D LIDAR scan to build the map
  • odometry [Odometry2Proto]: Odometry can either be read from this message or from the pose tree. The message is only used if the parameter <cite style="box-sizing: border-box;">use_pose_tree</cite> is set to false, otherwise odometry is read from the pose tree.

Outgoing messages

(none)

Parameters

  • file_path [string] [default=”/tmp”]: Directory path used to save map snapshots
  • build_map_period [double] [default=2.0]: How often the map is recomputed, in seconds
  • laser_matcher_resolution [double] [default=DegToRad(3.0)]: Resolution to be used in scan matcher angles
  • map_x_max [double] [default=100.]: Maximum x value of the initial map
  • map_y_max [double] [default=100.]: Maximum y value of the initial map
  • map_x_min [double] [default=-100.]: Minimum x value of the initial map
  • map_y_min [double] [default=-100.]: Minimum y value of the initial map
  • map_resolution [double] [default=0.1]: Distance between each pixel in the map
  • max_range [double] [default=32.0]: The maximum range of the lidar. This value should be close to the physical range of the lidar to exploit as much of the available information. This value must not be larger than the range of lidar for GMapping to operate.
  • map_update_range [double] [default=30.0]: The range within which the map is updated. The update range must be smaller or equal to the maximum range parameter as it relies on the lidar range information. The value chosen allows the tradeoff between the map global consistency and its sharpness.
  • number_particles [int] [default=40]: Number of particles used to estimate position of the robot
  • linear_distance [double] [default=0.3]: Linear threshold used to attempt scan matching
  • angular_distance [double] [default=0.1]: Angular threshold used to attempt scan matching
  • use_pose_tree [bool] [default=false]: Whether robot pose is read from pose tree or RX channel

isaac.lidar_slam.Cartographer

Description

This component wraps the Google Cartographer LIDAR SLAM library for ISAAC SDK. You can learn more about Cartographer on their webpage: https://google-cartographer.readthedocs.io/en/latest/. Please note that Cartographer is an experimental library and that results may vary depending on the LIDAR you are using or the environment you are trying to map.

Type: Codelet - This component ticks either periodically or when it receives messages.

Incoming messages

  • flatscan [FlatscanProto]: Cartographer uses a 2D LIDAR scan to build the map

Outgoing messages

(none)

Parameters

  • lua_configuration_directory [string] [default=”“]: Folders to search for Cartographer lua scripts, separated by comma
  • lua_configuration_basename [string] [default=”“]: File name of the specific Cartographer lua script to load
  • output_path [string] [default=”/tmp”]: Folder to write submaps and generated map
  • background_size [Vector2i] [default=Vector2i(1500, 1500)]: The size of the canvas for visualizing the map in sight (in grid cells)
  • background_translation [Vector2d] [default=Vector2d(-75, -75)]: Translation to apply on background image (in meters)
  • num_visible_submaps [int] [default=8]: Only the most recent submaps are visualized with sight for performance reasons.
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 219,869评论 6 508
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,716评论 3 396
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 166,223评论 0 357
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 59,047评论 1 295
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 68,089评论 6 395
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,839评论 1 308
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,516评论 3 420
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,410评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,920评论 1 319
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 38,052评论 3 340
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,179评论 1 352
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,868评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,522评论 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 32,070评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,186评论 1 272
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,487评论 3 375
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 45,162评论 2 356

推荐阅读更多精彩内容

  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,458评论 0 13
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 2,868评论 0 0
  • Introduction What is Bowtie 2? Bowtie 2 is an ultrafast a...
    wzz阅读 5,684评论 0 5
  • 英文文档,一开始我也是抗拒的,边翻译边看,也就花费了1个小时基本就阅读过了,我的英文基础其实很差。附上链接:链接:...
    lonecolonel阅读 9,911评论 3 1
  • 大漠浓烟月灰暗, 工业狂吞夺资源! 贪心不足多吃占, 牛羊畜禽缩小圈。 自然生态都在喊, 万里山河已尘染! 欲望人...
    红胡雄狮阅读 201评论 0 0