Upgrade to Pro — share decks privately, control downloads, hide ads and more …

M5Stack x ROS2

anoken
March 13, 2019

M5Stack x ROS2

anoken

March 13, 2019
Tweet

More Decks by anoken

Other Decks in Technology

Transcript

  1. ROS2 library for Arduino ROS2 library for Arduino ROBOTISのKyung-Wan Ki

    (@OpusK )氏 が開発中のライブラリ https://github.com/ROBOTIS-GIT/ros2arduino/
  2. $ git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git $ cd Micro-XRCE-DDS-Agent $ mkdir build

    && cd build $ cmake -DTHIRDPARTY=ON -DCONFIG_UDP_TRANSPORT_MTU=4096 - $ mkdir -p ~/ros2_ws/src $ cd ~/ros2_ws $ wget https://raw.githubusercontent.com/ros2/ros2/release-latest/ros2.repos $ vcs import src < ros2.repos $ sudo rosdep init $ rosdep update $ rosdep install --from-paths src --ignore-src --rosdistro crystal -y --skip-keys "console_b $ cd ~/ros2_ws/ $ colcon build --symlink-install --packages-ignore qt_gui_cpp rqt_gui_cpp $ cmake -DTHIRDPARTY=ON -DCONFIG_UDP_TRANSPORT_MTU=4096 - DCONFIG_SERIAL_TRANSPORT_MTU=4096 .. $ sudo make install $ sudo ldconfig /usr/local/lib/
  3. $ MicroXRCEAgent udp 2018 Agentの起動 ArduinoIDEでの書き込み void publishString_x(std_msgs::Int16* msg, void*

    arg) { (void)(arg); msg->data = IMU.ax *1000; } class StringPub : public ros2::Node { public: StringPub(): Node() { ros2::Publisher<std_msgs::Int16>* publisher_x = ros2::Publisher<std_msgs::Int16>* publisher_x = this->createPublisher<std_msgs::Int16>("acc"); this->createWallFreq(PUBLISH_FREQUENCY, (ros2::CallbackFunc)publishString_x, NULL, publisher_x); }}; void setup() { ros2::init(&udp, AGENT_IP, AGENT_PORT); } void loop() { ros2::spin(&StringNode); }