Optional Fields in Message

And I would personally add a even more obvious usecase : remote function call in python.
A function can have optional arguments, and since python works with references and implicit typing, a safe simple default for any type is None

if I have a function :

def do_that(fibnum, timeout = None): 
  return fibonnacci_compute(fib_num, timeout)

and I want to expose it to other nodes via a service :

float timeout
---
int fib_result
  • sending timeout == 0 (how the ROS1 msg type __init__ function initialize it) means return right away.
  • sending timeout == None (how the python api is built) means no timeout, ie. run for ever.

Nullable default arguments are core part of the language so it is not unusual to see such APIs in python.

So I think having some standard way to represent a nullable/optional field in a message would be very useful.