Giter Club home page Giter Club logo

kumo's Introduction

Kumo (雲)

latest version commits since latest version license deploy stable status deploy nightly status

Kumo (雲, cloud) is a ROS 2 package that provides a bridge server that enables communications between WebSocket applications and ROS 2 nodes.

Features

  • Serve ROS 2 bridge on a specified port and host.
  • Support Node, Publisher, Subscription, Client, and Service creation.
  • Support Topics and Services communication.

Requirement

Installation

Binary Packages

  • See releases for the latest version of this package.
  • Alternatively, this package also available on ICHIRO ITS Repository as ros-foxy-kumo package.

Build From Source

  • Install colcon as in this guide.
  • Build the project and source the result.
    $ colcon build
    $ source install/setup.bash

    See this guide for more information on how to setup a workspace in ROS 2.

Usage

Run the bridge server using bridge program (use -h to list all available parameters).

$ ros2 run kumo bridge

Supported Client Libraries

License

This project is maintained by ICHIRO ITS and licensed under the MIT License.

kumo's People

Contributors

jayantita avatar maroqijalil avatar segara2410 avatar threeal avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

nedieon owend

kumo's Issues

Create Simple WebSocket Server

Create a WebSocket server using the websockets library. Then, add a simple Node handler and Subscription handler that will be generated when clients requested to the WebSocket server. See ros2cli on how to generate a subscription with a message string instead of a message object.

Add Support to Check Service

Add support to check whether a service is ready or not using SERVICE_IS_READY that immediately return the result and WAIT_FOR_SERVICE that return the result if ready or after timeout.

Add Action Server Support

Add support to Action Server creation, destruction, handle goal, handle cancel, and handle execution.

Websocket Not Available Outside Localhost

I don't know why, the websockets library for python needed a hostname parameter aside of the port parameter to initialize the WebSocket server. Currently the default hostname is set to localhost, it works when tested on the same host, but failed when tested outside it. Perhaps there's some way that could enable the host to bind to all addresses instead of just the localhost address.

Separate the Msg to JSON Serialization

Separate programs that handle serialization between Msg and JSOn into a separate package. This package later could be used by another package (ex: the still planned configuration package).

Restructure Project

There's several things that need to be modified in this project.

  • Use import x instead of from x import y if the y value is not needed. For example, see __init__.py in the source directories of this project. This could also be used to avoid circular import as seen in this question.
    from .message_handlers import (CreateNodeHandler, CreateSubscriptionHandler,
    DestroySubscriptionHandler, SubscriptionCallbackHandler)
    from .message_handler import MessageHandler
    from .node_handler import NodeHandler
    from .subscription_handler import SubscriptionHandler
    # Prevent unused import error
    CreateNodeHandler
    CreateSubscriptionHandler
    DestroySubscriptionHandler
    SubscriptionCallbackHandler
    MessageHandler
    NodeHandler
    SubscriptionHandler
  • Separate concern of handlers to be a manager and several handlers. For example, there will be a MessageManager that will manages several MessageHandler.

Update Readme

Update the information inside the readme.md to includes information regarding about how to setup this project, usage, and several additional descriptions.

Remove Unused Serialization Function

Remove the following serialization functions as it's unused and already replaced by serialization function on Kumo JSON.

kumo/kumo/message.py

Lines 69 to 87 in bbd1145

def msg_to_dict(msg: MsgType) -> dict:
fields = msg.get_fields_and_field_types()
msg_dict = {}
for field in fields:
if hasattr(msg, field):
msg_dict[field] = getattr(msg, field)
return msg_dict
def dict_to_msg(msg_dict: dict, msg: MsgType) -> MsgType:
fields = msg.get_fields_and_field_types()
for field in fields:
if hasattr(msg, field):
setattr(msg, field, msg_dict.get(field))
return msg

ros2 launch passes extra --ros-args flag

Hello. When launching kumo bridge from a ros2 launch file, extra parameters are passed which cause parse_args() to error.
I did some searching but couldn't figure out how to turn this off from the ros2 side of things.

parallels@ubuntu:/media/psf/Workspace$ ros2 launch launch/demo.py 
[INFO] [launch]: All log files can be found below /home/parallels/.ros/log/2023-04-06-10-50-16-794536-ubuntu-547275
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [bridge-1]: process started with pid [547277]
[bridge-1] usage: ros2 run kumo bridge [-h] [--port PORT] [--hosts HOSTS [HOSTS ...]]
[bridge-1] ros2 run kumo bridge: error: unrecognized arguments: --ros-args
[ERROR] [bridge-1]: process has died [pid 547277, exit code 2, cmd '/media/psf/Workspace/install/kumo/lib/kumo/bridge --ros-args'].

A one-line fix would be changing this line in scripts/bridge.py to just ignore the extra parameters:

-    arg = parser.parse_args()
+    (arg, _) = parser.parse_known_args()

I can open a PR.

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.