GithubHelp home page GithubHelp logo

syrkinis / ros2arduino Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robotis-git/ros2arduino

0.0 0.0 0.0 583 KB

This library helps the Arduino board communicate with the ROS2 using XRCE-DDS.

License: Apache License 2.0

Shell 1.90% C++ 28.86% C 69.24%

ros2arduino's Introduction

ros2arduino Build Status

Arduino library for communicating with ROS2(DDS)


Version-specific dependencies

  • Recommend version (present)
ros2arduino ROS2 Micro-XRCE-DDS Agent
0.2.1 Dashing Diademata Patch6 1.3.0

For the Micro-XRCE-DDS Agent, please install it using following commands.

$ git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
$ cd Micro-XRCE-DDS-Agent && git checkout v1.3.0
$ mkdir build && cd build
$ source /opt/ros/dashing/setup.bash # to share libraries with ros2
$ cmake ..
$ make
$ sudo make install
$ sudo ldconfig /usr/local/lib/
  • All
ros2arduino ROS2 Micro-XRCE-DDS Agent
0.2.1 Dashing Diademata Patch6 1.3.0
0.1.4 Dashing Diademata Patch3 1.1.0
0.1.3 Dashing Diademata Patch3 1.1.0
0.1.2 Dashing Diademata Patch1 1.1.0
0.1.1 Dashing Diademata 1.1.0
0.0.9 Crystal Clemmys 1.0.1

Restrictions

Memory

  • RAM : >= 32Kb
  • Boards tested : Based on the normal behavior of publisher and subscriber.
    • OpenCR
    • Arduino MKR ZERO
    • ESP32 (not support TCP yet)

Communication

Implemented Note
Serial YES
UDP YES ESP32, Ethernet
TCP NO Debugging...

Getting Start

Dependancy Installation

You must install ROS2 and XRCE-DDS Agent. (The version should be the same as the Version-specific dependencies above)

Upload Arduino sketch

  • [File] - [Examples] - [ros2arduino]
    • Serial
      • [publisher]
    • UDP
      • [publisher_wifi_udp]
      • [publisher_ethernet_udp]
    • TCP
      • [publisher_wifi_tcp]
      • [publisher_ethernet_tcp]
  • [Sketch] - [Upload]

Excute Micro-XRCE-DDS Agent

  • Please refer to eProsima manual for Micro-XRCE-DDS-Agent usage.

  • 0.2.1 or above (Micro-XRCE-DDS-Agent 1.3.0)

    • Serial
      $ MicroXRCEAgent serial --dev /dev/ttyACM0 -b 115200
    • UDP
      $ MicroXRCEAgent udp4 -p 2018
    • TCP
      $ MicroXRCEAgent tcp4 -p 2018
  • 0.1.0 ~ 0.1.4 (Micro-XRCE-DDS-Agent 1.1.0)

    • Serial
      $ MicroXRCEAgent serial --dev /dev/ttyACM0 -b 115200
    • UDP
      $ MicroXRCEAgent udp -p 2018
    • TCP
      $ MicroXRCEAgent tcp -p 2018
  • 0.0.9 (Micro-XRCE-DDS-Agent 1.0.1)

    • Serial
      $ MicroXRCEAgent --serial /dev/ttyACM0 115200
    • UDP
      $ MicroXRCEAgent --udp 2018
    • TCP
      $ MicroXRCEAgent --tcp 2018

Check topic on ROS2

$ ros2 topic echo /arduino_chatter

Appendix: How to configure entities from reference file. (available at 0.1.1 or above)

  • Use the reference method supported by Client and Agent. Please refer to eProsima manual for detailed usage.

  • For this feature, you need to set UXR_CREATE_ENTITIES_USING_REF definition to 1.

     #define UXR_CREATE_ENTITIES_USING_REF 1
    • ros2arduino 0.1.1 ~ 0.1.4
      • You need to change the settings(library code) in ros2arduino library. (In the user_config.h)
  • Create .refs file(in XML format) and run the Agent with the following options:

     $ MicroXRCEAgent serial --dev /dev/ttyACM0 -b 115200 -r ros2arduino.refs
    • An example reference file is as follows.
      • ros2arduino.refs
         <profiles>
         	<participant profile_name="ros2arduino_xml_node">
         		<rtps>
         			<name>ros2arduino_basic_node</name>
         			<builtin>
         				<domainId>0</domainId>
         			</builtin>
         		</rtps>
         	</participant>
        
        
         	<data_writer profile_name="arduino_chatter">
         		<topic>
         			<kind>NO_KEY</kind>
         			<name>rt/arduino_chatter</name>
         			<dataType>std_msgs::msg::dds_::String_</dataType>
         			<historyQos>
         				<kind>KEEP_LAST</kind>
         				<depth>10</depth>
         			</historyQos>
         		</topic>
         	</data_writer>
        
        
         	<data_reader profile_name="arduino_led">
         		<topic>
         			<name>rt/arduino_led</name>
         			<dataType>std_msgs::msg::dds_::Bool_</dataType>
         		</topic>
         	</data_reader>
        
        
         	<topic profile_name="Bool">
         		<kind>NO_KEY</kind>
         		<name>Bool</name>
         		<dataType>std_msgs::msg::dds_::Bool_</dataType>
         	</topic>
        
         	<topic profile_name="String">
         		<kind>NO_KEY</kind>
         		<name>String</name>
         		<dataType>std_msgs::msg::dds_::String_</dataType>
         	</topic>
         </profiles>

Appendix: How to use the Security feature. (available at 0.1.1 or above)

This method should be preceded by the function described in "Appendix: How to configure entities from reference file."

And please check eProsima's manual for how to use it.


Development Note

Lastest release

  • Feature
    • Only one node available
    • Publisher
    • Subscriber
  • Communication
    • Serial
    • UDP

ros2arduino's People

Contributors

asukiaaa avatar hancheol-cho avatar njh avatar opusk avatar per1234 avatar taro83 avatar

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.