Skip to content

Commit

Permalink
[Misc] added docstring, removed an unnecessary print, replaced functi…
Browse files Browse the repository at this point in the history
…on call.
  • Loading branch information
tomsch420 committed Apr 2, 2024
1 parent 7f8ad1f commit 2cdc22b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pycram/designators/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def perform(self) -> None:
orientation = list(transformations.quaternion_from_euler(0, 0, angle, axes="sxyz"))

# create new robot pose
new_robot_pose = Pose(robot_position.to_list()[0], orientation)
new_robot_pose = Pose(robot_position.position_as_list(), orientation)

# turn robot
NavigateActionPerformable(new_robot_pose).perform()
Expand Down
6 changes: 5 additions & 1 deletion src/pycram/resolver/probabilistic/probabilistic_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def create_model(self) -> ProbabilisticCircuit:
event = outer_event & limiting_event
# go.Figure(event.plot()).show()
result, _ = centered_model.conditional(event)
print(result)
return result


Expand Down Expand Up @@ -179,6 +178,11 @@ def default_policy(self) -> ProbabilisticCircuit:
return GaussianCostmapModel().create_model()

def sample_to_action(self, sample: List) -> MoveAndPickUpPerformable:
"""
Convert a sample from the underlying distribution to a performable action.
:param sample: The sample
:return: The action
"""
arm, grasp, relative_x, relative_y = sample
position = [relative_x, relative_y, 0.]
pose = Pose(position, frame=self.object_designator.bullet_world_object.tf_frame)
Expand Down

0 comments on commit 2cdc22b

Please sign in to comment.