Skip to content
Snippets Groups Projects
Commit e3f7451e authored by Tommy Persson's avatar Tommy Persson
Browse files

Work on ROS2

parent 1bc6432c
Branches
Tags
No related merge requests found
import json import json
from lrs_exec.executor_factory import ExecutorFactory from lrs_exec.executor_factory import ExecutorFactory
from lrs_util.constraints import Constraints
from lrs_turtle.executors.base_executor import BaseExecutor from lrs_turtle.executors.base_executor import BaseExecutor
...@@ -37,8 +38,11 @@ class MoveToExecutorFactory(ExecutorFactory): ...@@ -37,8 +38,11 @@ class MoveToExecutorFactory(ExecutorFactory):
return MoveToExecutor(node, id) return MoveToExecutor(node, id)
def json_constraints(self, node_json): def json_constraints(self, node_json):
res = "" try:
jobj = {"speed": ["slow", "standard"]} cons = Constraints()
res = json.dumps(jobj, sort_keys=True, indent=4, separators=(',', ': ')) cons.set_possible_speeds(["slow", "standard"])
return res res = cons.get_json_str()
return res
except Exception as exc:
self.get_logger().error(f'EXCEPTION json_constraints: {type(exc)} - {exc}')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment