Coder Social home page Coder Social logo

ros2_d's Introduction

ros2_d - ROS2 client library written in Dlang

workflow

Document

This is a ROS2 client library written in Dlang that does not depend on ROS2 build infrastructure (colcon).

Sub packages

  • rcl_bind : D binding package of rcl
  • msg_gen : Message generator that reads IDL files
  • rcld : ROS2 client library API for D

Getting started

Prerequisites

  • libclang-dev (tested with libclang-10-dev)
  • clang (tested with clang-10)

Build

  1. Execute this command at your project root.

    • This will generate D message packages from visible ROS2 message packages.
    dub run ros2_d:msg_gen -- .dub/packages
  2. Add ros2_d to your project

    dub add ros2_d:rcld
  3. Add message packages you want to use

    • Open dub.json and add (e.g.) "std_msgs": ">=0.0.1" to dependencies section
  4. Build

    dub build

Before you execute that procedure, please be sure that necessary environment varialbles for ROS2. This means, you need to execute the following command before setting up.

source /opt/ros/$ROS_DISTRO/setup.bash

And if you have your own message type, please do the following command too.

source <your-ament-workspace>/install/setup.bash

When some of ROS2 message type definitions are changed, please do the following command again.

dub run ros2_d:msg_gen -- .dub/packages -r

Here is a example pacakge.

Supporting environments

  • OS
    • Linux (tested with Ubuntu 20.04)
  • ROS2 distribution
    • Foxy
    • Galactic
    • Rolling
  • Dlang
    • dmd (tested with dmd-2.098.0)
  • CPU
    • x86_64

For developer

Getting started

ros2_d's People

Contributors

nonanonno avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sibnick

ros2_d's Issues

Support all types of messages

Various of message examples are shown in test_interface_files. So check comprehensiveness by using it.

  • Arrays
  • BasicTypes
  • BoundedPlainSequences (from rolling)
  • BoundedSequences
  • Constants
  • Defaults
  • Empty
  • MultiNested
  • Nested
  • Strings
  • UnboundedSequences
  • WStrings

rosidl_generator_d を作成

msg 型を生成する rosidl_generator_d package を作成する。

Tasks

  • 作成方法調査
  • 型定義方法を検討
  • 実装

rcld package の作成

D client library である rcld package の枠を作成する。単にノードが起動すれば良い。

Tasks

  • フォルダ構成決め
  • rcld.Node クラスの作成
  • colcon build 対応 (optional)

Cannot build with dmd 2.098.1

https://github.com/nonanonno/ros2_d/runs/4628352818?check_suite_focus=true#step:4:24

/tmp/runner/work/_tool/dc/dmd-2.098.1/x64/dmd2/linux/bin64/../../src/phobos/std/container/slist.d(161,28): Error: copy constructor `std.container.slist.SList!(Structure).SList.Node.this(return ref scope inout(Node) p) inout` is not callable using argument types `(typeof(null), Structure)`
/tmp/runner/work/_tool/dc/dmd-2.098.1/x64/dmd2/linux/bin64/../../src/phobos/std/container/slist.d(161,28):        cannot pass rvalue argument `null` of type `typeof(null)` to parameter `return ref scope inout(Node) p`
/tmp/runner/work/_tool/dc/dmd-2.098.1/x64/dmd2/linux/bin64/../../src/phobos/std/container/slist.d(172,34): Error: template instance `std.container.slist.SList!(Structure).SList.createNodeChain!(Range)` error instantiating
/tmp/runner/work/_tool/dc/dmd-2.098.1/x64/dmd2/linux/bin64/../../src/phobos/std/container/slist.d(409,31):        instantiated from here: `insertAfterNode!(Range)`
/tmp/runner/work/_tool/dc/dmd-2.098.1/x64/dmd2/linux/bin64/../../src/phobos/std/container/slist.d(198,20):        instantiated from here: `insertFront!(Range)`
/tmp/runner/work/_tool/dc/dmd-2.098.1/x64/dmd2/linux/bin64/../../src/phobos/std/container/slist.d(294,21):        instantiated from here: `__ctor!(Range)`
msg_gen/source/msg_gen/parsers/idl.d(85,9):        instantiated from here: `SList!(Structure)`
/tmp/runner/work/_tool/dc/dmd-2.098.1/x64/dmd2/linux/bin64/dmd failed with exit code 1.
dub build :msg_gen : failed

Create a robust executor

Currently I'm facing the following issues.

  • Service
    • Pass rcl_wait more than two times while sending only one request
    • Result in 601
  • Subscription
    • Sometime failed with 401

pub/sub を追加

最低限の publisher / subscriber を作成する。

  • publisher
  • subscriber

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.