YdLidar

2020-03-22  本文已影响0人  YottaYuan

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

Parameters

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

Parameters

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

Outgoing messages

(none)

Parameters

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

Outgoing messages

(none)

Parameters

上一篇 下一篇

猜你喜欢

热点阅读