Generates JSON schemes from JSIDL files. JSIDL stands for JAUS Service Interface Definition Language and contains also message definitions used to generate JSON scheme files.
This package contains no JSIDL files. You can find such files in JausToolsSet or ROS/IOP Bridge.
Example scheme for QueryPlatformSpecifications:
{
"name": "QueryPlatformSpecifications",
"messageId": "2502",
"isCommand": false,
"description": "Request PlatformSpecifications data",
"type": "object",
"properties": {
"HeaderRec": {
"type": "object",
"comment": "",
"required": [
"MessageID"
],
"properties": {
"MessageID": {
"type": "string",
"jausType": "unsigned short integer",
"comment": "Two byte field to hold message ID",
"const": "2502"
}
}
}
},
"required": [
"HeaderRec"
]
}We use PyXB-X to generate python code for XMLSchema of JSIDL. Install dependencies:
pip install PyXB-XFor using as ROS1 package you need additionally
sudo apt install python3-catkin-pkg -yClone this repository to your preferred destination.
git clone https://github.com/fkie/iop-json-generatorIf you use it with ROS put this repository into ROS workspace and call
colcon build --packages-select fkie_iop_json_generator --symlink-install or for ROS1
roscd && catkin buildUse setup.py to install the code:
cd iop-json-generator/fkie_iop_json_generator
pip install . --break-system-packagesThe executable jsidl2json.py is now located in ~/.local/bin.
Note: to remove installed files call
pip uninstall fkie_iop_wireshark_plugin --break-system-packagesRun jsidl2json.py to generate the JSON schemes.
In ROS environment you can do it by
ros2 run fkie_iop_json_generator jsidl2json.pyor (ROS1)
rosrun fkie_iop_json_generator jsidl2json.pyotherwise
python3 ~/.local/bin/jsidl2json.pyIf no path for JSIDL files is given the script tries to find the fkie_iop_builder ROS package from ROS/IOP Bridge.
You can change this path with --input_path.
By default, the schemes are written into {cwd}/schemes directory. You can change it by --output_path.
You can exclude subfolder from parsing if they contain different versions of the same message, e.g.
ros2 run fkie_iop_json_generator jsidl2json.py --exclude urn.jaus.jss.core-v1.0 --input_path ~/tmp/jsidl --output_path ~/tmp/schemes -v