Skip to content

Commit 22e42b3

Browse files
committed
Parameterize the toolpath file
1 parent ca3f204 commit 22e42b3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

snp_motion_planning/src/motion_client.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,27 @@ class MotionClient(Node):
7373

7474
def __init__(self):
7575
super().__init__("motion_client")
76+
toolpath_default = os.path.join(
77+
get_package_share_directory("snp_motion_planning"),
78+
"config",
79+
"toolpath.yaml",
80+
)
81+
self.declare_parameter("toolpath_file", toolpath_default)
82+
self.toolpath_file = self.get_parameter("toolpath_file").get_parameter_value().string_value
83+
7684
self.planner = self.create_client(GenerateMotionPlan, "/generate_motion_plan")
7785
self.controller = ActionClient(
7886
self,
7987
FollowJointTrajectory,
8088
"/scaled_joint_trajectory_controller/follow_joint_trajectory",
8189
)
8290

91+
8392
def request_plan(self):
8493
"""Request a motion plan from the motion planning service."""
8594
req = GenerateMotionPlan.Request()
86-
inspection_toolpath = create_toolpath_from_yaml(
87-
"/workspace/src/scan_n_plan_workshop/snp_motion_planning/config/toolpath.yaml"
88-
)
89-
# print(inspection_toolpath)
95+
inspection_toolpath = create_toolpath_from_yaml(self.toolpath_file)
96+
9097
req.tool_paths = [inspection_toolpath]
9198
req.motion_group = "manipulator"
9299
req.tcp_frame = "tcp"

0 commit comments

Comments
 (0)