Skip to main content
If you previously published to beta.sysand.org, follow the migration guide to move your packages to sysand.com.

ros2-sysmlv2

published by seil-isr
9 released
Validated
Older version: You are viewing 0.1.0. The latest stable version is 0.1.1.
sysand add seil-isr/ros2-sysmlv2 0.1.0
README Source Changelog Licenses 0 usages 2 versions Validation

ros2-sysmlv2: a SysML v2 domain library for ROS2

ros2-sysmlv2

The first SysML v2 domain library for ROS2 robotics system architectures.

179 definitions across 17 source files covering message types, communication patterns, lifecycle, deployment, TF2, parameters, node archetypes, and the Nav2 navigation stack.

What this library is, and is not

This library is the type vocabulary for modeling ROS2 systems in SysML v2. You import it from your own .sysml models to obtain typed handles on messages, topics, services, actions, nodes, lifecycle states, QoS profiles, TF frames, and parameters that map directly to ROS2 Jazzy semantics. Every definition is validated against actual ROS2 source.

This library is not a code generator. A companion code-generation pipeline (separate project) reads models written against this vocabulary and generates buildable ROS2 packages. If you want runnable code from your SysML model, you want that pipeline; if you want the type vocabulary alone, you want this kpar.

A series of libraries

This is the first of a planned series of SysML v2 libraries for robotics from the same lab. It covers architecture and implementation: the ROS2 vocabulary a robot's software architecture is written against. Two companions are planned, a library for analysis, holding the model elements for design space exploration of robot architectures, and a library for verification, holding the elements for verifying them. Each will be published on the sysand index under the same organization.

Installation

# From the public index
sysand add pkg:sysand/seil-isr/ros2-sysmlv2

# From a local archive built with `sysand build`
sysand add file:///path/to/ros2-sysmlv2-<version>.kpar

Quick Start

package MyRobot {
    private import ros2_sysmlv2_lifecycle::*;
    private import ros2_sysmlv2_comm::*;
    private import ros2_sysmlv2_sensor_msgs::*;
    private import ros2_sysmlv2_archetypes::*;

    part def MyLidarNode :> SensorDriver {
        :>> nodeName = "lidar_driver";
        :>> updateRateHz = 10.0;
        :>> frameId = "lidar_link";

        port :>> sensorPub : TopicPublisher {
            :>> topicName = "/scan";
            :>> qos = sensorDataQoS;
            out item :>> msg : LaserScan;
        }
    }
}

Library Structure

Layer File(s) Definitions Description
Foundation foundation.sysml, std_msgs.sysml 10 Time, Duration, Header, ColorRGBA, etc.
Messages geometry_msgs.sysml, sensor_msgs.sysml, nav_msgs.sysml, trajectory_msgs.sysml, diagnostic_msgs.sysml, shape_msgs.sysml, action_msgs.sysml, visualization_msgs.sysml 100 85 ROS2 message types as item def
Communication comm.sysml 16 QoS, TopicPublisher/Subscriber, ServiceServer/Client, ActionServer/Client, connections
Lifecycle lifecycle.sysml 14 Node, LifecycleNode, LifecycleStates (5 states, 9 event-triggered transitions)
Deployment deployment.sysml 5 Executor, Container, CallbackGroup, NodeDeployment
Parameters params.sysml 5 ParameterTypeKind (10 values), ParameterDescriptor, ranges
TF2 tf2.sysml 7 CoordinateFrame, StaticTransform, DynamicTransform, REP 105 frames
Archetypes archetypes.sysml 8 8 abstract node patterns (SensorDriver, Controller, Planner, etc.)
Nav2 nav2.sysml 14 11 Nav2 server nodes, Nav2Stack composite, 13 action/message types

Mapping Conventions

SysML v2 ROS2
item def .msg type
port def with out item Topic publisher
port def with in item Topic subscriber
port def with in + out items Service or Action
part def Node class
part usage Node instance
connection Topic/service/action binding
state def with transition Lifecycle state machine
attribute def Parameter type

Ground Truth

All definitions are validated against actual ROS2 Jazzy source code:

  • Message types: field-by-field against .msg files from ros2/common_interfaces and ros2/rcl_interfaces
  • Communication: against rclpy/qos.py, rclpy/node.py, rmw/qos_profiles.h
  • Lifecycle: against lifecycle_msgs/msg/State.msg, Transition.msg, rclpy/lifecycle/node.py
  • Parameters: against rcl_interfaces/msg/ParameterDescriptor.msg, ParameterType.msg
  • Nav2 nodes: against Nav2 Jazzy server node C++ source (class inheritance, topic names, action servers)

Requirements

  • Sysand0.2.1
  • Syside Editor0.10.1 (free) for authoring with this library
  • Syside Automator0.10.1 (paid) for programmatic model access
  • Target runtime: ROS2 Jazzy: message, service, and action definitions follow the ROS2 Jazzy sources

Related

  • A companion pipeline (separate project) uses Syside Automator, Sensmetry's Python API for programmatic model access, to extract the ROS2 architecture from a SysML v2 model into a JSON intermediate representation and to generate buildable ROS2 packages, launch files, and runtime checks of the running system against the model.
  • Release history: see CHANGELOG.md.

Acknowledgements

Sensmetry provided a free academic license for Syside Modeler, which was used to author, validate, and visualize this library, and for the Syside Automator API behind the companion pipeline. The library is validated with syside check at zero errors and zero warnings.

License

Apache-2.0

Authors

Sai Sandeep Damera (sdamera@terpmail.umd.edu) University of Maryland, College Park