Yakut v0.10 released

To upgrade: pip install --upgrade yakut

Type discovery

Commands that operate on Cyphal ports (subscribe, publish, call) can automatically discover the type of the port by querying the network. If the data type is specified manually, version numbers can be omitted (the latest available is chosen by default).

Where one used to say this:

y sub 1234:uavcan.si.sample.mass.Scalar.1.0

The following form can be used instead:

y sub 1234

Discovery can only succeed if there are other publishers or subscribers on this subject that support introspection (most nodes do).

The call command now accepts a service name instead of service-ID, and the type is also optional. The required information will be sourced from the server beforehand. Verbose form:

y call 42 123:sirius_cyber_corp.PerformLinearLeastSquaresFit.1.0 'points: [{x: 10, y: 1}, {x: 20, y: 2}]'

New form (the old one is also supported ofc):

y q 42 least_squares '[[10, 1], [20, 2]]'  # new alias, shorthand initialization

Subject synchronization

yakut subscribe accepts multiple subjects for lockstep subscription:

$ y sub 100 110 120 140 150
---
100:
  heartbeat:
    readiness: {value: 3}
    health: {value: 0}
  demand_factor_pct: 2
110:
  timestamp: {microsecond: 1650748118444258}
  value:
    kinematics:
      angular_position: {radian: 5.42976188659668}
      angular_velocity: {radian_per_second: 111.61508178710938}
      angular_acceleration: {radian_per_second_per_second: -0.10802359879016876}
    torque: {newton_meter: 0.012790549546480179}
120:
  timestamp: {microsecond: 1650748118444258}
  value:
    current: {ampere: 0.055703502148389816}
    voltage: {volt: 24.92441749572754}
140: {dc_voltage: 125, dc_current: 0, phase_current_amplitude: 4, velocity: 111, ratiometric_setpoint: 9}
150:
  current: [0.0020294189453125, 0.70458984375]
  voltage: [0.1893310546875, 1.3359375]

Behavior graphically:

Tweaks

yakut monitor will truncate the output to avoid wrapping/scrolling so that it looks right even in small terminal windows.

yakut subscribe --redraw will redraw the output in place instead of scrolling.

Ugly stack traces are no longer printed on error unless --verbose --verbose is given.

Hi Pavel,

Nice to know that yakut now supports type discovery. I’m curious though on how this introspection you’re referring to works and where it’s documented?

Discovery can only succeed if there are other publishers or subscribers on this subject that support introspection (most nodes do).

Discovery per se is not documented anywhere, but the service it relies on is: it is the quite standard uavcan.register.Access, specifically this part pertaining to standard registers:

When the user is asking Yakut to publish or subscribe to a specific subject, it will query all registers whose name matches uavcan\.(pub|sub)\..*\.(id|type) from all nodes that are online and see if there are any that match the subject-ID provided by the user. The RPC call command works in an even simpler way: since it is given a service name directly, it will simply read uavcan.srv.SERVICE_NAME.id and uavcan.srv.SERVICE_NAME.type from the server node.

We could explore the possibility of defining a dedicated standard network service for faster subject type discovery but I presume there is relatively little use for that outside of development/diagnostic tasks.

The implementation of the subject resolver is here: yakut/subject_resolver.py at main · OpenCyphal/yakut · GitHub