Skip to content

Commit

Permalink
Merge pull request #20 from ZdenekM/master
Browse files Browse the repository at this point in the history
Parameter of type relative_pose now accepts json string as value
  • Loading branch information
ZdenekM authored Dec 18, 2019
2 parents c0c85bc + db17ce3 commit 12e3886
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arcor2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.3
0.1.4
8 changes: 6 additions & 2 deletions arcor2/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,12 @@ def parameters(self, action_id: str) -> Dict[str, Any]:
ret[param.id] = self.action_point(object_id, ap_id).get_joints(robot_id, value_id)

elif param.type == ActionParameterTypeEnum.RELATIVE_POSE:
assert isinstance(param.value, dict)
ret[param.id] = Pose.from_dict(param.value) # TODO do this in __post_init__ of ActionPoint?
if isinstance(param.value, str):
ret[param.id] = Pose.from_json(param.value) # TODO do this in __post_init__ of ActionPoint?
elif isinstance(param.value, dict):
ret[param.id] = Pose.from_dict(param.value)
else:
raise ResourcesException("Invalid type of parameter value!")

elif param.type in (ActionParameterTypeEnum.STRING_ENUM,
ActionParameterTypeEnum.INTEGER_ENUM):
Expand Down

0 comments on commit 12e3886

Please sign in to comment.