Package: hpl-rv-ros
HPL RV for ROSThis project provides tools to create and deploy runtime monitors for your Robot Operating System applications.InstallingUsageGitHub FeaturesToolingInstallingThis package can be installed withpip:pipinstallhpl-rv-rosUsageYou can use this project to generate code both as a library and as a standalone tool.First, you will need a mapping of ROS topic types to message types.
This can be specified in YAML or JSON formats, when provided as a file.
For example:%YAML1.2# file: topics.yaml---/a:std_msgs/Int64/b:std_msgs/Int64/p:std_msgs/Bool/q:std_msgs/BoolThen, you will also need to provide a HPL specification. This can be either a list of properties, or a.hplfile, depending on how you want to use this package.As a Standalone ToolThis package provides thehpl-rv-rosCLI script.Required Argumentsa path to the topic type mapping fileeither a list of properties or a list of.hplfiles, depending on flagsOptional Argumentsflag--rospy: generate ROS1 code instead of ROS2 codeflag-for--files: treat positional arguments as a list of paths to.hplfiles instead of a list of propertiesargument-oor--output: pass a path to an output file for the generated code (default: print to screen)ExampleTo generate ROS2 code:hpl-rv-ros-f-orclpy_node.pytopics.yamlproperties.hplTo generate ROS1 code:hpl-rv-ros--rospy-f-orospy_node.pytopics.yamlproperties.hplAs a LibraryThis repository provides thehplrv_rosPython package.ExamplefromtypingimportDict,ListfrompathlibimportPathfromhpl.astimportHplPropertyfromhpl.parserimportproperty_parserfromhplrv_ros.rclpyimportgenerate_nodeasgenerate_rclpyfromhplrv_ros.rospyimportgenerate_nodeasgenerate_rospyparser=property_parser()topic_types:Dict[str,str]={'/a':'std_msgs/Int32'}properties:List[HplProperty]=[parser.parse('globally: no /a {data > 0}')]rclpy_code:str=generate_rclpy(properties,topic_types)rospy_code:str=generate_rospy(properties,topic_types)path:Path=Path('rclpy_node.py')path.write_text(rclpy_code,encoding='utf-8')path=Path('rospy_node.py')path.write_text(rospy_code,encoding='utf-8')GitHub FeaturesThe.githubdirectory comes with a number of files to configure certain GitHub features.Various Issue templates can be found underISSUE_TEMPLATE.A Pull Request template can be found atPULL_REQUEST_TEMPLATE.md.Automatically mark issues as stale after a period of inactivity. The configuration file can be found at.stale.yml.Keep package dependencies up to date with Dependabot. The configuration file can be found atdependabot.yml.Keep Release Drafts automatically up to date with Pull Requests, using theRelease Drafter GitHub Action. The configuration file can be found atrelease-drafter.ymland the workflow atworkflows/release-drafter.yml.Automatic package building and publishing when pushing a new version tag tomain. The workflow can be found atworkflows/publish-package.yml.ToolingThis package sets up varioustoxenvironments for static checks, testing, building and publishing.
It is also configured withpre-commithooks to perform static checks and automatic formatting.If you do not usetox, you can build the package withbuildand install a development version withpip.Assumecdinto the repository's root.To install thepre-commithooks:pre-commitinstallTo run type checking:tox-etypecheckTo run linting tools:tox-elintTo run automatic formatting:tox-eformatTo run tests:toxTo build the package:tox-ebuildTo build the package (withbuild):python-mbuildTo clean the previous build files:tox-ecleanTo test package publication (publish toTest PyPI):tox-epublishTo publish the package to PyPI:tox-epublish----repositorypypiTo install an editable version:pipinstall-e.