Package: gecko_messages
MessagesMessage formats should be short and simple, but if you want, it can also be complex.Files:imu.tomlwhere the name of the message is the name of the fileglobal.tomlwhich holds common or global setting for alltoml(file) - > dict -> create_c/py -> string -> file
toml(string) -> dict -> create_c/py -> string -> file

read_folder(dir_path, output_path=./) -> calls below functions
read_toml(file) -> dict
read_tomls(string) -> dict

Msg_file(file_path, global_file=file_path/global.toml, output_path=./) -> string
Msg_string(str, global_str) -> stringBinary:https://linuxcommandlibrary.com/man/protocmsgcomp [--out_dir=DIR][--in_dir=DIR][--version][--verbose][--help][--cpp-only][--python-only]verbose:
num msg found: x
global found: t/f
Id, Msg_name, size, fmt
…Cpp and python need id2msg(int) -> stringMessage FileMessage use standard types:uint8orint8uint16orint16uint32orint32uint64orint64floatOr complex types:IDMessageInfo1vec_t{float x,y,z}2quat_t{float w,x,y,z}3twist_t{vec_t linear, vec_t angular}4wrench_t{vec_t force, vec_t torque}5pose_t{vec_t position, quat_t orientation}GlobalNow you can shorten your message file because a lot of the keys are repetitive across
message files. Basically, anything in the “global” space of a message file can be moved
to aglobal.tomlfile instead of putting it into a message file.[global]comments="string"namespace="string"license="string"# full text of what you want at the top of each fileversion="string"# anything you want like 1.0.2 or 2022.2.23frozen="bool"# is python dataclass frozen true or falsewrap_width="int"# line width for text wrapping, default = 70[global.serialize]yivo="bool"# true | falsemavlink="bool"# put native types in var_types VarTypes(name, size, fmt, id) ... native ids = 0,# complex ids > 0, remove complex altogether ids between 20 - 255. This is nice# to put message ids here, because you can see them all in one place and know you don’t# have any conflicts.[global.ids]imu_t=intcalibration_t=intmy_cool_msg=intawesome_msg=intMessage[enum.name]# optional, can have many of these, each must have# an original name and each value in an enum must# be unique (python uses `@unique` from `enum`# library)Val1=1Val2=2Val3=3# since python is not a strongly typed language, it will not always respect# default types, so what should be an array (float[3]), you can set to a# scalar int. C is the only one that will complain if you do this.[message]# type-var_name = array_dimensionfloat-x=1# float x = 0 or defaultfloat-y=2# float y[2]{0,0} or defaultfloat-z=1# var names can only be ascii letters, numbers and -vec_t-a=2# vec_t a[2]{{0,0,0},{0,0,0}}# add `#include “vec_t.hpp”` and `from vec_t import *` when generatedcomments="string"# optional, will be attached to the `struct`id="bool"# can be in global.toml [ids] or here, value must be between 20 - 255frozen="bool"# only for python dataclass[message.defaults]# optional, don't need to do thisx=12# set defaults for variablesy=[1,2]# don't need to define defaults for all variables# this is really a message library for serialization, so only put functions if# you really need to, otherwise, let some other part of your code base# handle this[functions]c="string"python="string"The minimum message file is:[message]float-x=1id=33# this can be in global.toml under [global.ids]name="simple"To DoAdd defaults to messageFixpython3.8 - 3.10 withtomlkitAdded ranges to types, but don't use them, remove?Add global wrap size default to 70 char wideAddpyandcfor builtin messages, wantvecin message andvec_tincFix comments ... do I need them?Fix or remove automatic defaults, messages with new types are not
getting setup correctly with defaults. Only allow custom defaults
for new messages. Maybe embed default in each type class orNoneif no default?MIT LicenseCopyright (c) 2023 gecko-roboticsPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.