Utility scripts for maintaining the PickNik website, in particular the Behaviors Hub.
These steps allow you to get the updated behaviors.xml, which should happen every release.
# In moveitpro repo when your REST API is running, get the generated XML data
curl -X GET http://localhost:3200/behaviors/data > behaviors_raw.xml
Enhances behaviors_raw.xml with usage information (Metadata fields with used_in attribute) showing which Objectives use each behavior.
Run this script from the PickNik website repository and point --workspace at your moveit_pro_example_ws checkout.
behaviors_raw.xml (downloaded from REST API) somewhere accessible from this repository, for example /tmp/behaviors_raw.xml or this repository’s scripts/ directory.# From the PickNik website repository root
python3 scripts/enrich_behaviors_with_usage.py --xml scripts/behaviors_raw.xml --workspace /path/to/moveit_pro_example_ws --output scripts/behaviors_with_usage.xml
# Example using temporary files outside the repository
python3 scripts/enrich_behaviors_with_usage.py --xml /tmp/behaviors_raw.xml --workspace /path/to/moveit_pro_example_ws --output /tmp/behaviors_with_usage.xml
Metadata elements with used_in attribute to each behavior’s MetadataFields showing:
used_in attribute contains a JSON array of usage objectspip install pyyaml)behaviors_raw.xml file (from REST API endpoint)moveit_pro_example_ws workspace with robot configsUpdates _data/behaviors.json with port information and metadata extracted from behaviors_with_usage.xml.
Run this script in the PickNik website repository.
# From project root
python scripts/update_behaviors_from_xml.py [path_to_behaviors_with_usage.xml]
# Example with default path
python scripts/update_behaviors_from_xml.py
# Example with custom XML path
python scripts/update_behaviors_from_xml.py /path/to/behaviors_with_usage.xml
used_in information from Metadata elements with used_in attribute (if present)# 1. In moveitpro repo - Get behaviors.xml from REST API and save it somewhere accessible
curl -X GET http://localhost:3200/behaviors/data > /tmp/behaviors_raw.xml
# 2. In the PickNik website repo - Enhance XML with usage information from moveit_pro_example_ws
python3 scripts/enrich_behaviors_with_usage.py --xml /tmp/behaviors_raw.xml --workspace /path/to/moveit_pro_example_ws --output /tmp/behaviors_with_usage.xml
# 3. In PickNik website repo - Convert to JSON
python scripts/update_behaviors_from_xml.py /tmp/behaviors_with_usage.xml