diff --git a/lecture_03/201_visualize_model_artist.py b/lecture_03/201_visualize_model_artist.py index de7495b..9395ab3 100644 --- a/lecture_03/201_visualize_model_artist.py +++ b/lecture_03/201_visualize_model_artist.py @@ -1,9 +1,49 @@ +"""Assignment 02: Build your own robot model +""" from compas.artists import Artist +from compas.datastructures import Mesh +from compas.geometry import Circle +from compas.geometry import Cylinder +from compas.geometry import Frame +from compas.geometry import Plane +from compas.geometry import Translation +from compas.robots import Configuration +from compas.robots import Joint from compas.robots import RobotModel -model = RobotModel.from_urdf_file("models/01_myfirst.urdf") +# create cylinder in yz plane +radius, length = 0.3, 5 +cylinder = Cylinder(Circle(Plane([0, 0, 0], [1, 0, 0]), radius), length) +cylinder.transform(Translation.from_vector([length / 2.0, 0, 0])) -artist = Artist(model, layer="Robot") -artist.clear_layer() +# create robot model +model = RobotModel("robot", links=[], joints=[]) + +# link meshes (calling Mesh.from_shape effectively creates a copy of the shape) +mesh1 = Mesh.from_shape(cylinder) +mesh2 = Mesh.from_shape(cylinder) + +# add links +link0 = model.add_link("world") +link1 = model.add_link("link1", visual_mesh=mesh1, visual_color=(0.2, 0.5, 0.6)) +link2 = model.add_link("link2", visual_mesh=mesh2, visual_color=(0.5, 0.6, 0.2)) + +# add joints between the links +axis = (0, 0, 1) + +origin = Frame.worldXY() +model.add_joint("joint1", Joint.CONTINUOUS, link0, link1, origin, axis) + +origin = Frame((length, 0, 0), (1, 0, 0), (0, 1, 0)) +model.add_joint("joint2", Joint.CONTINUOUS, link1, link2, origin, axis) + +# Create a configuration object matching the number of joints in your model +# configuration = .... + +# Update the model using the artist +artist = Artist(model) +# artist.update ... + +# Render everything artist.draw_visual() -artist.redraw() +artist.redraw() \ No newline at end of file diff --git a/lecture_03/210_build_your_own_robot.py b/lecture_03/210_build_your_own_robot.py index 7e68314..8363322 100644 --- a/lecture_03/210_build_your_own_robot.py +++ b/lecture_03/210_build_your_own_robot.py @@ -1,3 +1,5 @@ +"""Assignment 02: Build your own robot model +""" from compas.artists import Artist from compas.datastructures import Mesh from compas.geometry import Circle @@ -20,28 +22,35 @@ # link meshes (calling Mesh.from_shape effectively creates a copy of the shape) mesh1 = Mesh.from_shape(cylinder) mesh2 = Mesh.from_shape(cylinder) +mesh3 = Mesh.from_shape(cylinder) # add links link0 = model.add_link("world") link1 = model.add_link("link1", visual_mesh=mesh1, visual_color=(0.2, 0.5, 0.6)) link2 = model.add_link("link2", visual_mesh=mesh2, visual_color=(0.5, 0.6, 0.2)) +link3 = model.add_link("link3", visual_mesh=mesh3, visual_color=(0.3, 0.1, 0.7)) # add joints between the links -axis = (0, 0, 1) +axis = (0, 1, 0) -origin = Frame.worldXY() -model.add_joint("joint1", Joint.CONTINUOUS, link0, link1, origin, axis) +origin_1 = Frame.worldXY() +model.add_joint("joint1", Joint.CONTINUOUS, link0, link1, origin_1, axis) -origin = Frame((length, 0, 0), (1, 0, 0), (0, 1, 0)) -model.add_joint("joint2", Joint.CONTINUOUS, link1, link2, origin, axis) +origin_2 = Frame((length, 0, 0), (1, 0, 0), (0, 1, 0)) +model.add_joint("joint2", Joint.CONTINUOUS, link1, link2, origin_2, axis) + +origin_3 = Frame((length, 0, 0), (1, 0, 0), (0, 1, 0)) +model.add_joint("joint3", Joint.CONTINUOUS, link2, link3, origin_3, axis) # Create a configuration object matching the number of joints in your model -# configuration = .... +configuration = model.zero_configuration() #close to all zeros +configuration.joint_values =[50,45,35] # Update the model using the artist artist = Artist(model) -# artist.update ... +artist.update(configuration) # Render everything artist.draw_visual() artist.redraw() + diff --git a/lecture_04/assignment_03/1.png b/lecture_04/assignment_03/1.png new file mode 100644 index 0000000..7e89c6b Binary files /dev/null and b/lecture_04/assignment_03/1.png differ diff --git a/lecture_04/assignment_03/2.PNG b/lecture_04/assignment_03/2.PNG new file mode 100644 index 0000000..94821f0 Binary files /dev/null and b/lecture_04/assignment_03/2.PNG differ diff --git a/lecture_04/assignment_03/assignment_03_template.ghx b/lecture_04/assignment_03/assignment_03_template.ghx deleted file mode 100644 index 4ae4a5e..0000000 --- a/lecture_04/assignment_03/assignment_03_template.ghx +++ /dev/null @@ -1,2813 +0,0 @@ - - - - - - - - 0 - 2 - 2 - - - - - - - 1 - 0 - 7 - - - - - - c4f913db-409d-41a9-88e1-f6f90989047d - Shaded - 1 - - 100;150;0;0 - - - 100;0;150;0 - - - - - - 637527254194888879 - - assignment_03_template.ghx - - - - - 0 - - - - - - 251 - 6 - - 0.7225001 - - - - - 0 - - - - - - - 0 - - - - - 1 - - - - - GhPython, Version=7.27.23032.13001, Culture=neutral, PublicKeyToken=null - 7.27.23032.13001 - - 00000000-0000-0000-0000-000000000000 - - - - - - - - - 40 - - - - - c552a431-af5b-46a9-a8a4-0fcbc27ef596 - Group - - - - - 1 - - 150;170;135;255 - - A group of Grasshopper objects - bfe572e7-d997-4c3c-8488-4e03d01804ea - b278407c-79b3-49ef-a2c8-ee682b33d9ef - 6fe2e9d2-130c-4a02-b347-a1c6b831fc5a - 9a4be73c-3082-4c74-be27-41c7c1688c53 - 4 - 3dd78fb5-3c65-4715-b2db-b9489d44fd71 - Group - - - - - - - - - - - c552a431-af5b-46a9-a8a4-0fcbc27ef596 - Group - - - - - 1 - - 150;170;135;255 - - A group of Grasshopper objects - d5ffda3e-a3ab-4688-9de8-1d9d9e2789e3 - 4b0a07e0-a378-4f92-8f0a-6c1f1fb427f2 - 1d31a79f-b7ba-423f-944c-23f606999dae - eaec99d4-5f03-4209-953f-02aee1235de3 - 4a5bf47a-b0af-4831-a451-6b776364bb7e - 5 - 5a4ca04f-0f26-4978-bcce-92edaa3c4b8e - Group - - - - - - - - - - - c552a431-af5b-46a9-a8a4-0fcbc27ef596 - Group - - - - - 1 - - 150;170;135;255 - - A group of Grasshopper objects - 781a5de8-c54c-4805-927f-519a45da032f - 4b0a07e0-a378-4f92-8f0a-6c1f1fb427f2 - 1d31a79f-b7ba-423f-944c-23f606999dae - eaec99d4-5f03-4209-953f-02aee1235de3 - 4a5bf47a-b0af-4831-a451-6b776364bb7e - 20c7f0ab-fd13-4bd7-a130-c6fe893d2a0b - 47c152bc-c823-4835-aad3-3bf5c281e892 - d19cf29a-0512-4632-b4e0-ecc00c5b8487 - 2ceac33a-a5ff-4a42-8067-32e6a2c7fbee - ac227038-eb23-4cb5-94d8-f63bb92375a4 - b3787c61-219b-4ed9-b49f-1e7dd56236b1 - b395bfb0-5717-46c4-924c-a3ba167b1e0d - 4e66fe1b-29b3-4955-9524-ca986decd9ac - 78471367-17af-4599-8661-808ba87f82a6 - bfa816f1-e4c0-482e-9515-4b540fd2f427 - 82091d9c-f1c0-4207-8d3d-b1dca673d5df - 16 - 8b8d6fbf-db19-4267-9188-c4fdd76620b6 - Group - - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - 4e66fe1b-29b3-4955-9524-ca986decd9ac - Data - Robot - false - 0 - - - - - - 1254 - 170 - 50 - 20 - - - 1279.353 - 180.9772 - - - - - - - - - - 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe - Scribble - - - - - false - - 46.70692 - 119.7138 - - - 272.0458 - 119.7138 - - - 272.0458 - 139.8125 - - - 46.70692 - 139.8125 - - A quick note - Cambria - 82091d9c-f1c0-4207-8d3d-b1dca673d5df - false - Scribble - Scribble - 22 - 1) Load robot from ROS - - - - - - 41.70692 - 114.7138 - 235.3389 - 30.09863 - - - 46.70692 - 119.7138 - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - aacb02be-ffde-4997-b910-3a5670a6e5b1 - Data - Target planes - false - 0 - - - - - - 1226 - 516 - 78 - 20 - - - 1265.041 - 526.4604 - - - - - - - - - - c552a431-af5b-46a9-a8a4-0fcbc27ef596 - Group - - - - - 1 - - 150;240;218;146 - - A group of Grasshopper objects - 0c3c0677-cbf3-46be-b539-e48399697bc7 - de6b7a53-8f17-48cc-bb14-1aedc473dd1c - 04770360-9eb5-44e4-911f-142deec44bdc - aacb02be-ffde-4997-b910-3a5670a6e5b1 - 50ee1702-2c6a-4092-b68b-7fd9ec30c129 - 9dbe68e7-ae2d-4df4-89a9-ae0ec5759854 - d17c9d6f-7bf6-411c-816c-4c1caad151b9 - 7 - cf91e427-c398-45be-b915-f55275cc67b7 - Group - - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - d385349b-7e03-4362-b9d0-eacd34e2562b - Data - Pickup plane - false - 0 - - - - - - 1229 - 350 - 75 - 20 - - - 1266.929 - 360.6916 - - - - - - - - - - c552a431-af5b-46a9-a8a4-0fcbc27ef596 - Group - - - - - 1 - - 150;240;218;146 - - A group of Grasshopper objects - d385349b-7e03-4362-b9d0-eacd34e2562b - 66c3b06d-1415-476b-875b-53498de1860a - c9e84bc7-5f07-46ef-9e42-32f7d85d0c13 - 39a429c7-2480-4ff8-8f4c-5bd8a47369a7 - 224add91-1cc7-47af-8c77-af2d42147144 - ff0bbdd7-eb5b-4ed6-a652-505db2c0ac8c - 6 - 3c032157-3bf9-40ee-9b12-e4e807d15ccc - Group - - - - - - - - - - - 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe - Scribble - - - - - false - - 46.70692 - 281.4785 - - - 269.3387 - 281.4785 - - - 269.3387 - 301.5771 - - - 46.70692 - 301.5771 - - A quick note - Cambria - ff0bbdd7-eb5b-4ed6-a652-505db2c0ac8c - false - Scribble - Scribble - 22 - 2) Define pick-up plane - - - - - - 41.70692 - 276.4785 - 232.6318 - 30.09863 - - - 46.70692 - 281.4785 - - - - - - - - - - 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe - Scribble - - - - - false - - 46.70692 - 469.1947 - - - 263.9892 - 469.1947 - - - 263.9892 - 489.4223 - - - 46.70692 - 489.4223 - - A quick note - Cambria - 9dbe68e7-ae2d-4df4-89a9-ae0ec5759854 - false - Scribble - Scribble - 22 - 3) Define target planes - - - - - - 41.70692 - 464.1947 - 227.2822 - 30.22754 - - - 46.70692 - 469.1947 - - - - - - - - - - 410755b1-224a-4c1e-a407-bf32fb45ea7e - 00000000-0000-0000-0000-000000000000 - Robot Visualize - - - - - """ -Visualizes the robot. - -COMPAS FAB v0.27.0 -""" -from compas.artists import Artist -from compas.geometry import Frame -from compas.geometry import Transformation -from compas_fab.robots import PlanningScene -from ghpythonlib.componentbase import executingcomponent as component - - -class RobotVisualize(component): - def RunScript( - self, - robot, - group, - configuration, - show_visual, - show_collision, - show_frames, - show_base_frame, - show_end_effector_frame, - show_cm, - show_acm, - ): - - visual = None - collision = None - collision_meshes = None - attached_meshes = None - frames = None - base_frame = None - ee_frame = None - - if robot: - show_visual = True if show_visual is None else show_visual - show_cm = True if show_cm is None else show_cm - show_acm = True if show_acm is None else show_acm - configuration = configuration or robot.zero_configuration() - - robot.update(configuration, visual=show_visual, collision=show_collision) - compas_frames = robot.transformed_frames(configuration, group) - - if show_visual: - visual = robot.artist.draw_visual() - - if show_collision: - collision = robot.artist.draw_collision() - - if show_base_frame: - base_compas_frame = compas_frames[0] - artist = Artist(base_compas_frame) - base_frame = artist.draw() - - if show_end_effector_frame: - ee_compas_frame = robot.forward_kinematics( - configuration, group, options=dict(solver="model") - ) - artist = Artist(ee_compas_frame) - ee_frame = artist.draw() - - if show_frames: - frames = [] - for compas_frame in compas_frames[1:]: - artist = Artist(compas_frame) - frame = artist.draw() - frames.append(frame) - - if show_cm or show_acm: - scene = PlanningScene(robot) - scene = robot.client.get_planning_scene() - - collision_meshes = [] - attached_meshes = [] - - if show_cm: - for co in scene.world.collision_objects: - header = co.header - frame_id = header.frame_id - cms = co.to_collision_meshes() - - for cm in cms: - if cm.frame != Frame.worldXY(): - t = Transformation.from_frame(cm.frame) - mesh = cm.mesh.transformed(t) - else: - mesh = cm.mesh - - collision_meshes.append(Artist(mesh).draw()) - - if show_acm: - for aco in scene.robot_state.attached_collision_objects: - for acm in aco.to_attached_collision_meshes(): - frame_id = aco.object["header"]["frame_id"] - frame = robot.forward_kinematics( - configuration, options=dict(link=frame_id) - ) - t = Transformation.from_frame(frame) - - # Local CM frame - if ( - acm.collision_mesh.frame - and acm.collision_mesh.frame != Frame.worldXY() - ): - t = t * Transformation.from_frame( - acm.collision_mesh.frame - ) - - mesh = acm.collision_mesh.mesh.transformed(t) - - attached_meshes.append(Artist(mesh).draw()) - - return ( - visual, - collision, - collision_meshes, - attached_meshes, - frames, - base_frame, - ee_frame, - ) - - Visualizes the robot. -COMPAS FAB v0.27.0 - true - true - 2 - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAHYSURBVEhLtZSxSgNBEIZVCEFQTDoRi4BgLcQHCGJpkSaVja2dnYUglqlEbcQulUUqHyGFpYUvEMgTBDs7z/87do7ZvVUixIPvbndm55/Z2btbKYriX8kal0nW+Bd2b19b4oJnzl8z/BUJv4hCfIh+6o8mVCFGYiII7Hm/R74zMROI2xOI7di6NAhnGtATiN04vJ8xhXWExb/XEoQFpVM8iuswvxPWhhxRWzQ/ENXOUwcBz4IkD2FOAtrmRT1RGzWv2gPcKoOcCBNkT+gLkrB9gwM1f9kOPWkT7cM2M01uVQVysAvrIyL0PqoorKOdiFkhtNAfeNQin8AO1A7NKqolCetZ5w+c9dH3wC3toW+PMfFrPPJRCIVli6gZwuI0AUSFLErWKLHcW1MenK6BYACXFqOrLebBPq7sNvBIjG37N8W4wZ8VihMPKrsNUhBLxIGkLQkMnVib9c429zqRaIrE/BtijCTSDWJQVqvLdjX0GpFgisR+PHAJTYPgk/AJj71GJAgK5qvNiUZsnZyXgmvrG1+Nnb37ID5N9aIJKNi+5F/ZvhqXCWC10fwM46g9EE1AwQslgOb+YZUk0E31ogkokF+F/dR+ZfPo1M4B3lItqBmWTda4PIqVb4c7lSMXBSLEAAAAAElFTkSuQmCC - - false - 7a58f25a-3dc8-4dfa-bf0f-35404273569e - true - true - Robot Visualize - Robot Visualize - - - - - - 2356 - 139 - 257 - 204 - - - 2503 - 241 - - - - - - 10 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 7 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - - - - - true - The robot. - 439bbb30-bb2a-4f39-bfd6-8205cd93fd09 - robot - robot - true - 0 - true - 619d4216-bdfd-4395-b679-83b02e397c53 - 1 - 87f87f55-5b71-41f4-8aea-21d494016f81 - 2 - - - - - - 2358 - 141 - 130 - 20 - - - 2424.5 - 151 - - - - - - - - true - The planning group used for end-effector and base visualization. - ad36f822-0439-4ba3-b51a-c348f6f591ec - group - group - true - 0 - true - 0 - 37261734-eec7-4f50-b6a8-b8d1f3c4396b - - - - - - 2358 - 161 - 130 - 20 - - - 2424.5 - 171 - - - - - - - - true - The robot's full configuration. - 9fb95b19-f673-4906-9998-b63a5811ea88 - configuration - configuration - true - 0 - true - 4ca3f55b-10fb-41c3-9f24-2b4809b96eeb - 1 - 87f87f55-5b71-41f4-8aea-21d494016f81 - - - - - - 2358 - 181 - 130 - 20 - - - 2424.5 - 191 - - - - - - - - true - Whether or not to show the robot's visual meshes. - 22d8ace2-7a15-4a22-9430-2f721280765e - show_visual - show_visual - true - 0 - true - 0 - d60527f5-b5af-4ef6-8970-5f96fe412559 - - - - - - 2358 - 201 - 130 - 20 - - - 2424.5 - 211 - - - - - - - - true - Whether or not to show the robot's collision meshes. - ad827435-eaa9-47db-8456-0f04c22dde3a - show_collision - show_collision - true - 0 - true - 0 - d60527f5-b5af-4ef6-8970-5f96fe412559 - - - - - - 2358 - 221 - 130 - 20 - - - 2424.5 - 231 - - - - - - - - true - Whether or not to show the robot's joint frames. - 35824dc3-741e-4a85-9d9f-f350f6328850 - show_frames - show_frames - true - 0 - true - 0 - d60527f5-b5af-4ef6-8970-5f96fe412559 - - - - - - 2358 - 241 - 130 - 20 - - - 2424.5 - 251 - - - - - - - - true - Whether or not to show the robot's base frame. - 5c36de85-2908-4ed4-8bfb-be05a5fc15a0 - show_base_frame - show_base_frame - true - 0 - true - 0 - d60527f5-b5af-4ef6-8970-5f96fe412559 - - - - - - 2358 - 261 - 130 - 20 - - - 2424.5 - 271 - - - - - - - - true - Whether or not to show the robot's end-effector frame. - 43679585-4dff-44fc-8144-04d51b6597a3 - show_end_effector_frame - show_end_effector_frame - true - 0 - true - 0 - d60527f5-b5af-4ef6-8970-5f96fe412559 - - - - - - 2358 - 281 - 130 - 20 - - - 2424.5 - 291 - - - - - - - - true - Whether or not to show the collision meshes (if any). - b0245b8b-4b25-480e-8434-34500dd361dd - show_cm - show_cm - true - 0 - true - 0 - d60527f5-b5af-4ef6-8970-5f96fe412559 - - - - - - 2358 - 301 - 130 - 20 - - - 2424.5 - 311 - - - - - - - - true - Whether or not to show the attached collision meshes (if any). - c258dd5f-afd6-4742-9840-e8ae6df45c59 - show_acm - show_acm - true - 0 - true - 0 - d60527f5-b5af-4ef6-8970-5f96fe412559 - - - - - - 2358 - 321 - 130 - 20 - - - 2424.5 - 331 - - - - - - - - Rhino meshes of the robot's visual geometry (if any). - b51fd205-41de-4772-b77b-54118aa40c2c - visual - visual - false - 0 - - - - - - 2518 - 141 - 93 - 28 - - - 2564.5 - 155.2857 - - - - - - - - Rhino meshes of the robot's collision geometry (if any). - 3fd4309e-805a-4b2a-8b39-fb39cda51d21 - collision - collision - false - 0 - - - - - - 2518 - 169 - 93 - 29 - - - 2564.5 - 183.8571 - - - - - - - - Rhino meshes of the scene's collision meshes (if any). - ba8f5aaf-7d4f-4021-b0f3-328651e5f766 - collision_meshes - collision_meshes - false - 0 - - - - - - 2518 - 198 - 93 - 28 - - - 2564.5 - 212.4286 - - - - - - - - Rhino meshes of the scene's attached collision meshes (if any). - 00b4652c-1968-4bef-b124-5b86f4dc25bc - attached_meshes - attached_meshes - false - 0 - - - - - - 2518 - 226 - 93 - 29 - - - 2564.5 - 241 - - - - - - - - The robot's joint frames as Rhino planes (if any). - 243eeb3c-e1ad-4233-9a1a-b0ec9fd1c962 - frames - frames - false - 0 - - - - - - 2518 - 255 - 93 - 28 - - - 2564.5 - 269.5714 - - - - - - - - The robot's base frame as a Rhino plane (if any). - 91fd1995-e0da-4f23-a4c6-afeefc044dee - base_frame - base_frame - false - 0 - - - - - - 2518 - 283 - 93 - 29 - - - 2564.5 - 298.1429 - - - - - - - - The robot's end-effector frame as a Rhino plane (if any). - 5a2c4711-ae2f-4f0f-b633-afc7c8fccfd2 - ee_frame - ee_frame - false - 0 - - - - - - 2518 - 312 - 93 - 29 - - - 2564.5 - 326.7143 - - - - - - - - - - - - - - 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe - Scribble - - - - - false - - 46.70692 - 651.1613 - - - 317.5712 - 651.1613 - - - 317.5712 - 671.2599 - - - 46.70692 - 671.2599 - - A quick note - Cambria - fccb98c9-c6e5-4caa-8384-ca0ddf85fd1f - false - Scribble - Scribble - 22 - 4) Solve IK for pick-up plane - - - - - - 41.70692 - 646.1613 - 280.8643 - 30.09863 - - - 46.70692 - 651.1613 - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - 02bc89eb-6961-419b-a5c7-ecf1d7beb296 - Data - Pickup config - false - 0 - - - - - - 1226 - 749 - 78 - 20 - - - 1265.877 - 759.2832 - - - - - - - - - - 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe - Scribble - - - - - false - - 73.59002 - 675.2849 - - - 238.8633 - 675.2849 - - - 238.8633 - 689.9958 - - - 73.59002 - 689.9958 - - A quick note - Cambria - 6e5b9db8-970d-4e5b-bf3d-6ec1c492b072 - false - Scribble - Scribble - 16 - Results in pickup config - - - - - - 68.59002 - 670.2849 - 175.2733 - 24.71094 - - - 73.59002 - 675.2849 - - - - - - - - - - c552a431-af5b-46a9-a8a4-0fcbc27ef596 - Group - - - - - 1 - - 150;240;218;146 - - A group of Grasshopper objects - fccb98c9-c6e5-4caa-8384-ca0ddf85fd1f - 02bc89eb-6961-419b-a5c7-ecf1d7beb296 - 6e5b9db8-970d-4e5b-bf3d-6ec1c492b072 - fb4c5d39-e0a5-4c45-b606-72de43c589ac - b96209a7-93e4-4212-b096-c83e82b4da7b - 98209ace-c305-4683-b351-d9b9daf31e36 - 6 - 3962a36b-d451-45d1-acb9-c99a5708db90 - Group - - - - - - - - - - - 00027467-0d24-4fa7-b178-8dc0ac5f42ec - Value List - - - - - Provides a list of preset values to choose from - 137a3255-a54e-4e4c-a9c3-e6d902b2a8bb - 2 - 3 - Value List - List - false - 0 - - - - - 0 - Pickup config - true - - - - - 1 - Trajectory - false - - - - - - 1591 - 171 - 123 - 22 - - - - - - - - - - eeafc956-268e-461d-8e73-ee05c6f72c01 - Stream Filter - - - - - Filters a collection of input streams - 471af287-d88e-43f4-9bb2-98daa088f633 - Stream Filter - Filter - - - - - - 2046 - 170 - 77 - 64 - - - 2078 - 202 - - - - - - 3 - 2e3ab970-8545-46bb-836c-1c11e5610bce - 8ec86459-bf01-4409-baee-174d0d2b13d0 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - 1 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - - - - - Index of Gate stream - fde7ac2c-1b3d-473c-8b2b-4addc4d52e1a - Gate - G - false - 137a3255-a54e-4e4c-a9c3-e6d902b2a8bb - 1 - - - - - - 2048 - 172 - 15 - 20 - - - 2057 - 182 - - - - - - 1 - - - - - 1 - {0} - - - - - 0 - - - - - - - - - - - 2 - Input stream at index 0 - e6a67ce5-d55f-4ec2-a44c-573291be81a5 - false - Stream 0 - 0 - true - a38644b3-ef3b-4bc2-bf1d-8843907a4a1f - 1 - - - - - - 2048 - 192 - 15 - 20 - - - 2057 - 202 - - - - - - - - 2 - Input stream at index 1 - 14985ec3-7977-426f-bc6b-ad27afc61e04 - false - Stream 1 - 1 - true - a4b043bc-8e30-4b4c-bb40-e7f42497696d - 1 - - - - - - 2048 - 212 - 15 - 20 - - - 2057 - 222 - - - - - - - - 2 - Filtered stream - ddfd1927-535b-4f08-acf1-f1762fa62a54 - false - Stream - S(0) - false - 0 - - - - - - 2093 - 172 - 28 - 60 - - - 2107 - 202 - - - - - - - - - - - - - - c552a431-af5b-46a9-a8a4-0fcbc27ef596 - Group - - - - - 1 - - 150;0;155;194 - - A group of Grasshopper objects - 7a58f25a-3dc8-4dfa-bf0f-35404273569e - 137a3255-a54e-4e4c-a9c3-e6d902b2a8bb - 471af287-d88e-43f4-9bb2-98daa088f633 - 766f518e-d29b-4814-a406-a45e5ded4a64 - e4b338fe-125d-4929-92e1-4e17c08f9b3b - f53212f5-507f-4bda-b372-34bf2b7020a3 - a38644b3-ef3b-4bc2-bf1d-8843907a4a1f - e9d20ac9-0dbc-44cb-9f48-878ae446678f - 619d4216-bdfd-4395-b679-83b02e397c53 - df7fb28b-31b3-40c8-ab8a-ec66c12ea055 - 10 - ca0ff086-508f-4122-8664-195d1a456efe - Group - - - - - - - - - - - 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe - Scribble - - - - - false - - 1582.769 - 120.3864 - - - 1707.132 - 120.3864 - - - 1707.132 - 135.9304 - - - 1582.769 - 135.9304 - - A quick note - Cambria - 766f518e-d29b-4814-a406-a45e5ded4a64 - false - Scribble - Scribble - 22 - Visualization - - - - - - 1577.769 - 115.3864 - 134.3623 - 25.54398 - - - 1582.769 - 120.3864 - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - b96209a7-93e4-4212-b096-c83e82b4da7b - Data - Pickup plane - false - d385349b-7e03-4362-b9d0-eacd34e2562b - 1 - 2 - - - - - - 70 - 735 - 75 - 20 - - - 108.0366 - 745.3143 - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - 98209ace-c305-4683-b351-d9b9daf31e36 - Data - Robot - false - 4e66fe1b-29b3-4955-9524-ca986decd9ac - 1 - 2 - - - - - - 70 - 711 - 50 - 20 - - - 95.8785 - 721.4962 - - - - - - - - - - 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe - Scribble - - - - - false - - 46.70692 - 861.2363 - - - 379.9403 - 861.2363 - - - 379.9403 - 881.4101 - - - 46.70692 - 881.4101 - - A quick note - Cambria - ba94b074-3f68-4274-8b84-f87aa5c4cb3e - false - Scribble - Scribble - 22 - 5) Plan trajectory to selected plane - - - - - - 41.70692 - 856.2363 - 343.2334 - 30.17383 - - - 46.70692 - 861.2363 - - - - - - - - - - 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe - Scribble - - - - - false - - 75.11641 - 888.1221 - - - 314.835 - 888.1221 - - - 314.835 - 902.8331 - - - 75.11641 - 902.8331 - - A quick note - Cambria - 01b0a494-be40-47b6-bdc4-7c92967b9f38 - false - Scribble - Scribble - 16 - From pickup config to target plane - - - - - - 70.11641 - 883.1221 - 249.7186 - 24.71094 - - - 75.11641 - 888.1221 - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - 55db7485-e593-4762-a166-64303d976c7a - Data - Target planes - false - aacb02be-ffde-4997-b910-3a5670a6e5b1 - 1 - 2 - - - - - - 70 - 998 - 78 - 20 - - - 109.1617 - 1008.612 - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - 538c02c6-6b3b-4712-a784-dda0bc63f847 - Data - Robot - false - 4e66fe1b-29b3-4955-9524-ca986decd9ac - 1 - 2 - - - - - - 70 - 941 - 50 - 20 - - - 95.34219 - 951.0811 - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - c666c109-2ccb-4c50-90cd-00130af76eaa - Data - Pickup config - false - 02bc89eb-6961-419b-a5c7-ecf1d7beb296 - 1 - 2 - - - - - - 70 - 969 - 78 - 20 - - - 109.694 - 979.456 - - - - - - - - - - 57da07bd-ecab-415d-9d86-af36d7073abc - Number Slider - - - - - Numeric slider for single values - e4b338fe-125d-4929-92e1-4e17c08f9b3b - Number Slider - - false - 0 - - - - - - 1591 - 205 - 160 - 20 - - - 1591.409 - 205.586 - - - - - - 3 - 1 - 1 - 100 - 0 - 0 - 0 - - - - - - - - - 59daf374-bc21-4a5e-8282-5504fb7ae9ae - List Item - - - - - 0 - Retrieve a specific item from a list. - df7fb28b-31b3-40c8-ab8a-ec66c12ea055 - List Item - Item - - - - - - 2163 - 190 - 64 - 64 - - - 2197 - 222 - - - - - - 3 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - 2e3ab970-8545-46bb-836c-1c11e5610bce - cb95db89-6165-43b6-9c41-5702bc5bf137 - 1 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - - - - - 1 - Base list - 39c89e61-bc93-43d0-a501-c5bba7a3da6e - List - L - false - ddfd1927-535b-4f08-acf1-f1762fa62a54 - 1 - - - - - - 2165 - 192 - 17 - 20 - - - 2175 - 202 - - - - - - - - Item index - 83d287eb-3d9d-4785-b735-156766b364e7 - Index - i - false - e4b338fe-125d-4929-92e1-4e17c08f9b3b - 1 - - - - - - 2165 - 212 - 17 - 20 - - - 2175 - 222 - - - - - - 1 - - - - - 1 - {0} - - - - - 0 - - - - - - - - - - - Wrap index to list bounds - 60da4aea-66d4-49fc-8aa9-a5189edc913b - Wrap - W - false - 0 - - - - - - 2165 - 232 - 17 - 20 - - - 2175 - 242 - - - - - - 1 - - - - - 1 - {0} - - - - - true - - - - - - - - - - - Item at {i'} - 4ca3f55b-10fb-41c3-9f24-2b4809b96eeb - false - Item - i - false - 0 - - - - - - 2212 - 192 - 13 - 60 - - - 2218.5 - 222 - - - - - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - bcf27a28-24e5-4d31-8438-444d7fe511cb - Data - Trajectory - false - 0 - - - - - - 1243 - 1025 - 61 - 20 - - - 1274.394 - 1035.907 - - - - - - - - - - 410755b1-224a-4c1e-a407-bf32fb45ea7e - 00000000-0000-0000-0000-000000000000 - GhPython Script - - - - - configs = trajectory.points - GhPython provides a Python script component - - 182 - 182 - - - 558 - 571 - - true - true - 2 - false - f53212f5-507f-4bda-b372-34bf2b7020a3 - false - true - GhPython Script - get configs - - - - - - 1704 - 315 - 132 - 28 - - - 1774 - 329 - - - - - - 1 - 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 - 1 - 8ec86459-bf01-4409-baee-174d0d2b13d0 - - - - - true - Script variable Python - 50f68354-3c25-4a84-a5f7-ddaf267be516 - trajectory - trajectory - true - 0 - true - e9d20ac9-0dbc-44cb-9f48-878ae446678f - 1 - 87f87f55-5b71-41f4-8aea-21d494016f81 - - - - - - 1706 - 317 - 53 - 24 - - - 1734 - 329 - - - - - - - - Script output configs. - a4b043bc-8e30-4b4c-bb40-e7f42497696d - a - configs - false - 0 - - - - - - 1789 - 317 - 45 - 24 - - - 1811.5 - 329 - - - - - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - a38644b3-ef3b-4bc2-bf1d-8843907a4a1f - Data - Pickup config - false - 02bc89eb-6961-419b-a5c7-ecf1d7beb296 - 1 - 2 - - - - - - 1591 - 300 - 78 - 20 - - - 1630.11 - 310.7518 - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - e9d20ac9-0dbc-44cb-9f48-878ae446678f - Data - Trajectory - false - bcf27a28-24e5-4d31-8438-444d7fe511cb - 1 - 2 - - - - - - 1591 - 324 - 61 - 20 - - - 1621.626 - 334.0815 - - - - - - - - - - 8ec86459-bf01-4409-baee-174d0d2b13d0 - Data - - - - - Contains a collection of generic data - 619d4216-bdfd-4395-b679-83b02e397c53 - Data - Robot - false - 4e66fe1b-29b3-4955-9524-ca986decd9ac - 1 - 2 - - - - - - 1591 - 275 - 50 - 20 - - - 1616.464 - 285.9058 - - - - - - - - - - c552a431-af5b-46a9-a8a4-0fcbc27ef596 - Group - - - - - 1 - - 150;240;218;146 - - A group of Grasshopper objects - ba94b074-3f68-4274-8b84-f87aa5c4cb3e - 01b0a494-be40-47b6-bdc4-7c92967b9f38 - 55db7485-e593-4762-a166-64303d976c7a - 97392278-c93e-4240-86e9-5e59dc2eb992 - 4a09e38e-e49b-43a1-809e-f310b5a4c3e2 - 1f8b3c58-8382-468d-8885-a179a0ad05e0 - 538c02c6-6b3b-4712-a784-dda0bc63f847 - c666c109-2ccb-4c50-90cd-00130af76eaa - 13b3eb29-3c6d-41ba-80fe-d6214ebc9674 - 9d4e5cda-5bb7-42fe-acfa-968fa6c6c067 - cd76efff-9d02-4eb1-b6dd-080d6a0e6d4d - bcf27a28-24e5-4d31-8438-444d7fe511cb - 12 - 4c3c7466-b1c2-4942-9ac0-63cb70a5b6b7 - Group - - - - - - - - - - - 59e0b89a-e487-49f8-bab8-b5bab16be14c - Panel - - - - - A panel for custom notes and text values - ecc8c71a-07d9-4980-90b1-a3cd2f8081a6 - Panel - - false - 0 - 0 - Define multiple target planes in any way you like, for example, -reference a curve from Rhino, divide it and assign a plane to each point - -Make sure all planes are oriented in a way that makes sense -for the robot to reach it as well. - - - - - - -530 - 485 - 523 - 96 - - 0 - 0 - 0 - - - - - 3 - - 255;255;250;90 - - true - true - true - false - false - true - - - - - Courier New - 8 - - - - - - - - - - - 59e0b89a-e487-49f8-bab8-b5bab16be14c - Panel - - - - - A panel for custom notes and text values - fb166dfc-4abf-4aa5-9ecf-d86922966dfe - Panel - - false - 0 - 0 - Define one pick-up plane in any way you like, -for example, reference a point from Rhino and assign a plane to it. - -Make sure the plane is oriented in a way that makes sense -for the robot to reach it. You can check this by observing the -results of the IK solution for this pickup-plane. - - - - - - -536 - 293 - 529 - 96 - - 0 - 0 - 0 - - -535.2353 - 293.4706 - - - - - - 3 - - 255;255;250;90 - - true - true - true - false - false - true - - - - - Courier New - 8 - - - - - - - - - - - 59e0b89a-e487-49f8-bab8-b5bab16be14c - Panel - - - - - A panel for custom notes and text values - c7cc41e4-23fe-4958-87c2-e75feb10ebac - Panel - - false - 0 - 0 - Load the robot from ROS. - -Make sure ROS/MoveIt is running before you start (ie. "Compose up"). - - - - - - -536 - 124 - 529 - 96 - - 0 - 0 - 0 - - -535.2353 - 124.4706 - - - - - - 3 - - 255;255;250;90 - - true - true - true - false - false - true - - - - - Courier New - 8 - - - - - - - - - - - 59e0b89a-e487-49f8-bab8-b5bab16be14c - Panel - - - - - A panel for custom notes and text values - 3f032319-94be-407d-8e0f-7615f6976834 - Panel - - false - 0 - 0 - Use inverse kinematics of the robot to find -a feasible configuration to reach the pickup plane. - -You can use the COMPAS FAB component or -code it in a GHPython component. - - - - - - -530 - 680 - 523 - 96 - - 0 - 0 - 0 - - -529.5882 - 680.8822 - - - - - - 3 - - 255;255;250;90 - - true - true - true - false - false - true - - - - - Courier New - 8 - - - - - - - - - - - 59e0b89a-e487-49f8-bab8-b5bab16be14c - Panel - - - - - A panel for custom notes and text values - 1f02a236-cf56-4437-8d21-1243b22a7b8e - Panel - - false - 0 - 0 - With the pickup config and a list of target planes, you are ready to compute the solution trajectory for each plane. - -First create a constraint from the selected plane, then use the plan free-space motion to calculate a trajectory. - - - - - - -530 - 942 - 523 - 96 - - 0 - 0 - 0 - - -529.353 - 942.6469 - - - - - - 3 - - 255;255;250;90 - - true - true - true - false - false - true - - - - - Courier New - 8 - - - - - - - - - - - - - - - - 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 - - - - - \ No newline at end of file diff --git a/lecture_04/assignment_03/francesco_milano/assignment_03.ghx b/lecture_04/assignment_03/francesco_milano/assignment_03.ghx new file mode 100644 index 0000000..1b25df8 --- /dev/null +++ b/lecture_04/assignment_03/francesco_milano/assignment_03.ghx @@ -0,0 +1,6283 @@ + + + + + + + + 0 + 2 + 2 + + + + + + + 1 + 0 + 7 + + + + + + c4f913db-409d-41a9-88e1-f6f90989047d + Shaded + 1 + + 100;150;0;0 + + + 100;0;150;0 + + + + + + 637527254194888879 + + assignment_03.ghx + + + + + 0 + + + + + + -7660 + -554 + + 4.789214 + + + + + 0 + + + + + + + 0 + + + + + 1 + + + + + GhPython, Version=7.28.23058.3001, Culture=neutral, PublicKeyToken=null + 7.28.23058.3001 + + 00000000-0000-0000-0000-000000000000 + + + + + + + + + 62 + + + + + c552a431-af5b-46a9-a8a4-0fcbc27ef596 + Group + + + + + 1 + + 150;170;135;255 + + A group of Grasshopper objects + bfe572e7-d997-4c3c-8488-4e03d01804ea + b278407c-79b3-49ef-a2c8-ee682b33d9ef + 6fe2e9d2-130c-4a02-b347-a1c6b831fc5a + 9a4be73c-3082-4c74-be27-41c7c1688c53 + 4 + 3dd78fb5-3c65-4715-b2db-b9489d44fd71 + Group + + + + + + + + + + + c552a431-af5b-46a9-a8a4-0fcbc27ef596 + Group + + + + + 1 + + 150;170;135;255 + + A group of Grasshopper objects + d5ffda3e-a3ab-4688-9de8-1d9d9e2789e3 + 4b0a07e0-a378-4f92-8f0a-6c1f1fb427f2 + 1d31a79f-b7ba-423f-944c-23f606999dae + eaec99d4-5f03-4209-953f-02aee1235de3 + 4a5bf47a-b0af-4831-a451-6b776364bb7e + 5 + 5a4ca04f-0f26-4978-bcce-92edaa3c4b8e + Group + + + + + + + + + + + c552a431-af5b-46a9-a8a4-0fcbc27ef596 + Group + + + + + 1 + + 150;170;135;255 + + A group of Grasshopper objects + 781a5de8-c54c-4805-927f-519a45da032f + 4b0a07e0-a378-4f92-8f0a-6c1f1fb427f2 + 1d31a79f-b7ba-423f-944c-23f606999dae + eaec99d4-5f03-4209-953f-02aee1235de3 + 4a5bf47a-b0af-4831-a451-6b776364bb7e + 20c7f0ab-fd13-4bd7-a130-c6fe893d2a0b + 47c152bc-c823-4835-aad3-3bf5c281e892 + d19cf29a-0512-4632-b4e0-ecc00c5b8487 + 2ceac33a-a5ff-4a42-8067-32e6a2c7fbee + ac227038-eb23-4cb5-94d8-f63bb92375a4 + b3787c61-219b-4ed9-b49f-1e7dd56236b1 + b395bfb0-5717-46c4-924c-a3ba167b1e0d + 4e66fe1b-29b3-4955-9524-ca986decd9ac + 78471367-17af-4599-8661-808ba87f82a6 + bfa816f1-e4c0-482e-9515-4b540fd2f427 + 82091d9c-f1c0-4207-8d3d-b1dca673d5df + 16 + 8b8d6fbf-db19-4267-9188-c4fdd76620b6 + Group + + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + 4e66fe1b-29b3-4955-9524-ca986decd9ac + Data + Robot + false + db86a617-4f10-4df1-b030-ab74bd417a7b + 1 + + + + + + 1266 + 135 + 50 + 20 + + + 1291.765 + 145.9772 + + + + + + + + + + 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe + Scribble + + + + + false + + 46.70692 + 119.7138 + + + 272.0458 + 119.7138 + + + 272.0458 + 139.8124 + + + 46.70692 + 139.8124 + + A quick note + Cambria + 82091d9c-f1c0-4207-8d3d-b1dca673d5df + false + Scribble + Scribble + 22 + 1) Load robot from ROS + + + + + + 41.70692 + 114.7138 + 235.3389 + 30.09864 + + + 46.70692 + 119.7138 + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + aacb02be-ffde-4997-b910-3a5670a6e5b1 + Data + Target planes + false + b3cbcb2b-392a-479b-a624-1921bce18104 + 1 + + + + + + 1238 + 506 + 78 + 20 + + + 1277.619 + 516.4604 + + + + + + + + + + c552a431-af5b-46a9-a8a4-0fcbc27ef596 + Group + + + + + 1 + + 150;240;218;146 + + A group of Grasshopper objects + 0c3c0677-cbf3-46be-b539-e48399697bc7 + de6b7a53-8f17-48cc-bb14-1aedc473dd1c + 04770360-9eb5-44e4-911f-142deec44bdc + aacb02be-ffde-4997-b910-3a5670a6e5b1 + 50ee1702-2c6a-4092-b68b-7fd9ec30c129 + 9dbe68e7-ae2d-4df4-89a9-ae0ec5759854 + d17c9d6f-7bf6-411c-816c-4c1caad151b9 + 7 + cf91e427-c398-45be-b915-f55275cc67b7 + Group + + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + d385349b-7e03-4362-b9d0-eacd34e2562b + Data + Pickup plane + false + e20789bc-7ff4-494c-89fb-ed8c0aa530b1 + 1 + + + + + + 1241 + 340 + 75 + 20 + + + 1278.53 + 350.6916 + + + + + + + + + + c552a431-af5b-46a9-a8a4-0fcbc27ef596 + Group + + + + + 1 + + 150;240;218;146 + + A group of Grasshopper objects + d385349b-7e03-4362-b9d0-eacd34e2562b + 66c3b06d-1415-476b-875b-53498de1860a + c9e84bc7-5f07-46ef-9e42-32f7d85d0c13 + 39a429c7-2480-4ff8-8f4c-5bd8a47369a7 + 224add91-1cc7-47af-8c77-af2d42147144 + ff0bbdd7-eb5b-4ed6-a652-505db2c0ac8c + 6 + 3c032157-3bf9-40ee-9b12-e4e807d15ccc + Group + + + + + + + + + + + 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe + Scribble + + + + + false + + 46.70692 + 281.4785 + + + 269.3387 + 281.4785 + + + 269.3387 + 301.5771 + + + 46.70692 + 301.5771 + + A quick note + Cambria + ff0bbdd7-eb5b-4ed6-a652-505db2c0ac8c + false + Scribble + Scribble + 22 + 2) Define pick-up plane + + + + + + 41.70692 + 276.4785 + 232.6318 + 30.09863 + + + 46.70692 + 281.4785 + + + + + + + + + + 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe + Scribble + + + + + false + + 46.70692 + 469.1947 + + + 263.9891 + 469.1947 + + + 263.9891 + 489.4222 + + + 46.70692 + 489.4222 + + A quick note + Cambria + 9dbe68e7-ae2d-4df4-89a9-ae0ec5759854 + false + Scribble + Scribble + 22 + 3) Define target planes + + + + + + 41.70692 + 464.1947 + 227.2822 + 30.22754 + + + 46.70692 + 469.1947 + + + + + + + + + + 410755b1-224a-4c1e-a407-bf32fb45ea7e + 00000000-0000-0000-0000-000000000000 + Robot Visualize + + + + + """ +Visualizes the robot. + +COMPAS FAB v0.27.0 +""" +from compas.artists import Artist +from compas.geometry import Frame +from compas.geometry import Transformation +from compas_fab.robots import PlanningScene +from ghpythonlib.componentbase import executingcomponent as component + + +class RobotVisualize(component): + def RunScript( + self, + robot, + group, + configuration, + show_visual, + show_collision, + show_frames, + show_base_frame, + show_end_effector_frame, + show_cm, + show_acm, + ): + + visual = None + collision = None + collision_meshes = None + attached_meshes = None + frames = None + base_frame = None + ee_frame = None + + if robot: + show_visual = True if show_visual is None else show_visual + show_cm = True if show_cm is None else show_cm + show_acm = True if show_acm is None else show_acm + configuration = configuration or robot.zero_configuration() + + robot.update(configuration, visual=show_visual, collision=show_collision) + compas_frames = robot.transformed_frames(configuration, group) + + if show_visual: + visual = robot.artist.draw_visual() + + if show_collision: + collision = robot.artist.draw_collision() + + if show_base_frame: + base_compas_frame = compas_frames[0] + artist = Artist(base_compas_frame) + base_frame = artist.draw() + + if show_end_effector_frame: + ee_compas_frame = robot.forward_kinematics( + configuration, group, options=dict(solver="model") + ) + artist = Artist(ee_compas_frame) + ee_frame = artist.draw() + + if show_frames: + frames = [] + for compas_frame in compas_frames[1:]: + artist = Artist(compas_frame) + frame = artist.draw() + frames.append(frame) + + if show_cm or show_acm: + scene = PlanningScene(robot) + scene = robot.client.get_planning_scene() + + collision_meshes = [] + attached_meshes = [] + + if show_cm: + for co in scene.world.collision_objects: + header = co.header + frame_id = header.frame_id + cms = co.to_collision_meshes() + + for cm in cms: + if cm.frame != Frame.worldXY(): + t = Transformation.from_frame(cm.frame) + mesh = cm.mesh.transformed(t) + else: + mesh = cm.mesh + + collision_meshes.append(Artist(mesh).draw()) + + if show_acm: + for aco in scene.robot_state.attached_collision_objects: + for acm in aco.to_attached_collision_meshes(): + frame_id = aco.object["header"]["frame_id"] + frame = robot.forward_kinematics( + configuration, options=dict(link=frame_id) + ) + t = Transformation.from_frame(frame) + + # Local CM frame + if ( + acm.collision_mesh.frame + and acm.collision_mesh.frame != Frame.worldXY() + ): + t = t * Transformation.from_frame( + acm.collision_mesh.frame + ) + + mesh = acm.collision_mesh.mesh.transformed(t) + + attached_meshes.append(Artist(mesh).draw()) + + return ( + visual, + collision, + collision_meshes, + attached_meshes, + frames, + base_frame, + ee_frame, + ) + + Visualizes the robot. +COMPAS FAB v0.27.0 + true + true + 2 + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEAAACxABrSO9dQAAAdhJREFUSEu1lLFKA0EQhlUIQVBMOhGLgGAtxAcIYmmRJpWNrZ2dhSCWqURtxC6VRSofIYWlhS8QyBMEOzvP/zt2jtm9VSLEg+9ud2bnn9nZu1spiuJfyRqXSdb4F3ZvX1vigmfOXzP8FQm/iEJ8iH7qjyZUIUZiIgjseb9HvjMxE4jbE4jt2Lo0CGca0BOI3Ti8nzGFdYTFv9cShAWlUzyK6zC/E9aGHFFbND8Q1c5TBwHPgiQPYU4C2uZFPVEbNa/aA9wqg5wIE2RP6AuSsH2DAzV/2Q49aRPtwzYzTW5VBXKwC+sjIvQ+qiiso52IWSG00B941CKfwA7UDs0qqiUJ61nnD5z10ffALe2hb48x8Ws88lEIhWWLqBnC4jQBRIUsStYosdxbUx6croFgAJcWo6st5sE+ruw28EiMbfs3xbjBnxWKEw8quw1SEEvEgaQtCQydWJv1zjb3OpFoisT8G2KMJNINYlBWq8t2NfQakWCKxH48cAlNg+CT8AmPvUYkCArmq82JRmydnJeCa+sbX42dvfsgPk31ogko2L7kX9m+GpcJYLXR/AzjqD0QTUDBCyWA5v5hlSTQTfWiCSiQX4X91H5l8+jUzgHeUi2oGZZN1rg8ipVvhzuVIxcFIsQAAAAASUVORK5CYII= + + false + 7a58f25a-3dc8-4dfa-bf0f-35404273569e + true + true + Robot Visualize + Robot Visualize + + + + + + 2349 + 170 + 257 + 204 + + + 2496 + 272 + + + + + + 10 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 7 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + true + The robot. + 439bbb30-bb2a-4f39-bfd6-8205cd93fd09 + robot + robot + true + 0 + true + 619d4216-bdfd-4395-b679-83b02e397c53 + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + 2 + + + + + + 2351 + 172 + 130 + 20 + + + 2417.5 + 182 + + + + + + + + true + The planning group used for end-effector and base visualization. + ad36f822-0439-4ba3-b51a-c348f6f591ec + group + group + true + 0 + true + 0 + 37261734-eec7-4f50-b6a8-b8d1f3c4396b + + + + + + 2351 + 192 + 130 + 20 + + + 2417.5 + 202 + + + + + + + + true + The robot's full configuration. + 9fb95b19-f673-4906-9998-b63a5811ea88 + configuration + configuration + true + 0 + true + 4ca3f55b-10fb-41c3-9f24-2b4809b96eeb + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 2351 + 212 + 130 + 20 + + + 2417.5 + 222 + + + + + + + + true + Whether or not to show the robot's visual meshes. + 22d8ace2-7a15-4a22-9430-2f721280765e + show_visual + show_visual + true + 0 + true + 0 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 2351 + 232 + 130 + 20 + + + 2417.5 + 242 + + + + + + + + true + Whether or not to show the robot's collision meshes. + ad827435-eaa9-47db-8456-0f04c22dde3a + show_collision + show_collision + true + 0 + true + 0 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 2351 + 252 + 130 + 20 + + + 2417.5 + 262 + + + + + + + + true + Whether or not to show the robot's joint frames. + 35824dc3-741e-4a85-9d9f-f350f6328850 + show_frames + show_frames + true + 0 + true + 0 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 2351 + 272 + 130 + 20 + + + 2417.5 + 282 + + + + + + + + true + Whether or not to show the robot's base frame. + 5c36de85-2908-4ed4-8bfb-be05a5fc15a0 + show_base_frame + show_base_frame + true + 0 + true + 0 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 2351 + 292 + 130 + 20 + + + 2417.5 + 302 + + + + + + + + true + Whether or not to show the robot's end-effector frame. + 43679585-4dff-44fc-8144-04d51b6597a3 + show_end_effector_frame + show_end_effector_frame + true + 0 + true + 0 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 2351 + 312 + 130 + 20 + + + 2417.5 + 322 + + + + + + + + true + Whether or not to show the collision meshes (if any). + b0245b8b-4b25-480e-8434-34500dd361dd + show_cm + show_cm + true + 0 + true + 0 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 2351 + 332 + 130 + 20 + + + 2417.5 + 342 + + + + + + + + true + Whether or not to show the attached collision meshes (if any). + c258dd5f-afd6-4742-9840-e8ae6df45c59 + show_acm + show_acm + true + 0 + true + 0 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 2351 + 352 + 130 + 20 + + + 2417.5 + 362 + + + + + + + + Rhino meshes of the robot's visual geometry (if any). + b51fd205-41de-4772-b77b-54118aa40c2c + visual + visual + false + 0 + + + + + + 2511 + 172 + 93 + 28 + + + 2557.5 + 186.2857 + + + + + + + + Rhino meshes of the robot's collision geometry (if any). + 3fd4309e-805a-4b2a-8b39-fb39cda51d21 + collision + collision + false + 0 + + + + + + 2511 + 200 + 93 + 29 + + + 2557.5 + 214.8571 + + + + + + + + Rhino meshes of the scene's collision meshes (if any). + ba8f5aaf-7d4f-4021-b0f3-328651e5f766 + collision_meshes + collision_meshes + false + 0 + + + + + + 2511 + 229 + 93 + 28 + + + 2557.5 + 243.4286 + + + + + + + + Rhino meshes of the scene's attached collision meshes (if any). + 00b4652c-1968-4bef-b124-5b86f4dc25bc + attached_meshes + attached_meshes + false + 0 + + + + + + 2511 + 257 + 93 + 29 + + + 2557.5 + 272 + + + + + + + + The robot's joint frames as Rhino planes (if any). + 243eeb3c-e1ad-4233-9a1a-b0ec9fd1c962 + frames + frames + false + 0 + + + + + + 2511 + 286 + 93 + 28 + + + 2557.5 + 300.5714 + + + + + + + + The robot's base frame as a Rhino plane (if any). + 91fd1995-e0da-4f23-a4c6-afeefc044dee + base_frame + base_frame + false + 0 + + + + + + 2511 + 314 + 93 + 29 + + + 2557.5 + 329.1429 + + + + + + + + The robot's end-effector frame as a Rhino plane (if any). + 5a2c4711-ae2f-4f0f-b633-afc7c8fccfd2 + ee_frame + ee_frame + false + 0 + + + + + + 2511 + 343 + 93 + 29 + + + 2557.5 + 357.7143 + + + + + + + + + + + + + + 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe + Scribble + + + + + false + + 46.70692 + 651.1613 + + + 317.5712 + 651.1613 + + + 317.5712 + 671.2599 + + + 46.70692 + 671.2599 + + A quick note + Cambria + fccb98c9-c6e5-4caa-8384-ca0ddf85fd1f + false + Scribble + Scribble + 22 + 4) Solve IK for pick-up plane + + + + + + 41.70692 + 646.1613 + 280.8643 + 30.09863 + + + 46.70692 + 651.1613 + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + 02bc89eb-6961-419b-a5c7-ecf1d7beb296 + Data + Pickup config + false + e722e2ce-e57b-4708-be92-6df9a6f144f0 + 1 + + + + + + 1238 + 741 + 78 + 20 + + + 1277.917 + 751.2832 + + + + + + + + + + 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe + Scribble + + + + + false + + 73.59002 + 675.2849 + + + 238.8635 + 675.2849 + + + 238.8635 + 689.9958 + + + 73.59002 + 689.9958 + + A quick note + Cambria + 6e5b9db8-970d-4e5b-bf3d-6ec1c492b072 + false + Scribble + Scribble + 16 + Results in pickup config + + + + + + 68.59002 + 670.2849 + 175.2734 + 24.71094 + + + 73.59002 + 675.2849 + + + + + + + + + + c552a431-af5b-46a9-a8a4-0fcbc27ef596 + Group + + + + + 1 + + 150;240;218;146 + + A group of Grasshopper objects + fccb98c9-c6e5-4caa-8384-ca0ddf85fd1f + 02bc89eb-6961-419b-a5c7-ecf1d7beb296 + 6e5b9db8-970d-4e5b-bf3d-6ec1c492b072 + fb4c5d39-e0a5-4c45-b606-72de43c589ac + b96209a7-93e4-4212-b096-c83e82b4da7b + 98209ace-c305-4683-b351-d9b9daf31e36 + 6 + 3962a36b-d451-45d1-acb9-c99a5708db90 + Group + + + + + + + + + + + 00027467-0d24-4fa7-b178-8dc0ac5f42ec + Value List + + + + + Provides a list of preset values to choose from + 137a3255-a54e-4e4c-a9c3-e6d902b2a8bb + 2 + 3 + Value List + List + false + 0 + + + + + 0 + Pickup config + false + + + + + 1 + Trajectory + true + + + + + + 1591 + 171 + 227 + 22 + + + + + + + + + + eeafc956-268e-461d-8e73-ee05c6f72c01 + Stream Filter + + + + + Filters a collection of input streams + 471af287-d88e-43f4-9bb2-98daa088f633 + Stream Filter + Filter + + + + + + 2046 + 170 + 77 + 64 + + + 2078 + 202 + + + + + + 3 + 2e3ab970-8545-46bb-836c-1c11e5610bce + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 1 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + Index of Gate stream + fde7ac2c-1b3d-473c-8b2b-4addc4d52e1a + Gate + G + false + 137a3255-a54e-4e4c-a9c3-e6d902b2a8bb + 1 + + + + + + 2048 + 172 + 15 + 20 + + + 2057 + 182 + + + + + + 1 + + + + + 1 + {0} + + + + + 0 + + + + + + + + + + + 2 + Input stream at index 0 + e6a67ce5-d55f-4ec2-a44c-573291be81a5 + false + Stream 0 + 0 + true + a38644b3-ef3b-4bc2-bf1d-8843907a4a1f + 1 + + + + + + 2048 + 192 + 15 + 20 + + + 2057 + 202 + + + + + + + + 2 + Input stream at index 1 + 14985ec3-7977-426f-bc6b-ad27afc61e04 + false + Stream 1 + 1 + true + a4b043bc-8e30-4b4c-bb40-e7f42497696d + 1 + + + + + + 2048 + 212 + 15 + 20 + + + 2057 + 222 + + + + + + + + 2 + Filtered stream + ddfd1927-535b-4f08-acf1-f1762fa62a54 + false + Stream + S(1) + false + 0 + + + + + + 2093 + 172 + 28 + 60 + + + 2107 + 202 + + + + + + + + + + + + + + c552a431-af5b-46a9-a8a4-0fcbc27ef596 + Group + + + + + 1 + + 150;0;155;194 + + A group of Grasshopper objects + 7a58f25a-3dc8-4dfa-bf0f-35404273569e + 137a3255-a54e-4e4c-a9c3-e6d902b2a8bb + 471af287-d88e-43f4-9bb2-98daa088f633 + 766f518e-d29b-4814-a406-a45e5ded4a64 + e4b338fe-125d-4929-92e1-4e17c08f9b3b + f53212f5-507f-4bda-b372-34bf2b7020a3 + a38644b3-ef3b-4bc2-bf1d-8843907a4a1f + e9d20ac9-0dbc-44cb-9f48-878ae446678f + 619d4216-bdfd-4395-b679-83b02e397c53 + df7fb28b-31b3-40c8-ab8a-ec66c12ea055 + 10 + ca0ff086-508f-4122-8664-195d1a456efe + Group + + + + + + + + + + + 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe + Scribble + + + + + false + + 1582.769 + 120.3864 + + + 1707.131 + 120.3864 + + + 1707.131 + 135.9303 + + + 1582.769 + 135.9303 + + A quick note + Cambria + 766f518e-d29b-4814-a406-a45e5ded4a64 + false + Scribble + Scribble + 22 + Visualization + + + + + + 1577.769 + 115.3864 + 134.3623 + 25.54395 + + + 1582.769 + 120.3864 + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + b96209a7-93e4-4212-b096-c83e82b4da7b + Data + Pickup plane + false + d385349b-7e03-4362-b9d0-eacd34e2562b + 1 + 2 + + + + + + 70 + 735 + 75 + 20 + + + 108.0366 + 745.3143 + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + 98209ace-c305-4683-b351-d9b9daf31e36 + Data + Robot + false + 4e66fe1b-29b3-4955-9524-ca986decd9ac + 1 + 2 + + + + + + 70 + 711 + 50 + 20 + + + 95.8785 + 721.4962 + + + + + + + + + + 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe + Scribble + + + + + false + + 46.70692 + 861.2363 + + + 379.9403 + 861.2363 + + + 379.9403 + 881.4102 + + + 46.70692 + 881.4102 + + A quick note + Cambria + ba94b074-3f68-4274-8b84-f87aa5c4cb3e + false + Scribble + Scribble + 22 + 5) Plan trajectory to selected plane + + + + + + 41.70692 + 856.2363 + 343.2334 + 30.17383 + + + 46.70692 + 861.2363 + + + + + + + + + + 7f5c6c55-f846-4a08-9c9a-cfdc285cc6fe + Scribble + + + + + false + + 75.11641 + 888.1221 + + + 314.8351 + 888.1221 + + + 314.8351 + 902.833 + + + 75.11641 + 902.833 + + A quick note + Cambria + 01b0a494-be40-47b6-bdc4-7c92967b9f38 + false + Scribble + Scribble + 16 + From pickup config to target plane + + + + + + 70.11641 + 883.1221 + 249.7187 + 24.71094 + + + 75.11641 + 888.1221 + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + 55db7485-e593-4762-a166-64303d976c7a + Data + Target planes + false + aacb02be-ffde-4997-b910-3a5670a6e5b1 + 1 + 2 + + + + + + 70 + 998 + 78 + 20 + + + 109.1617 + 1008.612 + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + 538c02c6-6b3b-4712-a784-dda0bc63f847 + Data + Robot + false + 4e66fe1b-29b3-4955-9524-ca986decd9ac + 1 + 2 + + + + + + 70 + 941 + 50 + 20 + + + 95.34219 + 951.0811 + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + c666c109-2ccb-4c50-90cd-00130af76eaa + Data + Pickup config + false + 02bc89eb-6961-419b-a5c7-ecf1d7beb296 + 1 + 2 + + + + + + 70 + 969 + 78 + 20 + + + 109.694 + 979.456 + + + + + + + + + + 57da07bd-ecab-415d-9d86-af36d7073abc + Number Slider + + + + + Numeric slider for single values + e4b338fe-125d-4929-92e1-4e17c08f9b3b + Number Slider + + false + 0 + + + + + + 1595 + 205 + 160 + 20 + + + 1595.339 + 205.586 + + + + + + 3 + 1 + 1 + 100 + 0 + 0 + 100 + + + + + + + + + 59daf374-bc21-4a5e-8282-5504fb7ae9ae + List Item + + + + + 0 + Retrieve a specific item from a list. + df7fb28b-31b3-40c8-ab8a-ec66c12ea055 + List Item + Item + + + + + + 2235 + 190 + 64 + 64 + + + 2269 + 222 + + + + + + 3 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 2e3ab970-8545-46bb-836c-1c11e5610bce + cb95db89-6165-43b6-9c41-5702bc5bf137 + 1 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + 1 + Base list + 39c89e61-bc93-43d0-a501-c5bba7a3da6e + List + L + false + ddfd1927-535b-4f08-acf1-f1762fa62a54 + 1 + + + + + + 2237 + 192 + 17 + 20 + + + 2247 + 202 + + + + + + + + Item index + 83d287eb-3d9d-4785-b735-156766b364e7 + Index + i + false + b7563f7c-f296-42be-9f19-e12c3a812f51 + 1 + + + + + + 2237 + 212 + 17 + 20 + + + 2247 + 222 + + + + + + 1 + + + + + 1 + {0} + + + + + 0 + + + + + + + + + + + Wrap index to list bounds + 60da4aea-66d4-49fc-8aa9-a5189edc913b + Wrap + W + false + 0 + + + + + + 2237 + 232 + 17 + 20 + + + 2247 + 242 + + + + + + 1 + + + + + 1 + {0} + + + + + true + + + + + + + + + + + Item at {i'} + 4ca3f55b-10fb-41c3-9f24-2b4809b96eeb + false + Item + i + false + 0 + + + + + + 2284 + 192 + 13 + 60 + + + 2290.5 + 222 + + + + + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + bcf27a28-24e5-4d31-8438-444d7fe511cb + Data + Trajectory + false + cee0f055-8a23-4e3a-a479-c3f2c06b24af + 1 + + + + + + 1251 + 999 + 61 + 20 + + + 1282.394 + 1009.627 + + + + + + + + + + 410755b1-224a-4c1e-a407-bf32fb45ea7e + 00000000-0000-0000-0000-000000000000 + GhPython Script + + + + + configs = trajectory.points + GhPython provides a Python script component + + 182 + 182 + + + 558 + 571 + + true + true + 2 + false + f53212f5-507f-4bda-b372-34bf2b7020a3 + false + true + GhPython Script + get configs + + + + + + 1704 + 315 + 132 + 28 + + + 1774 + 329 + + + + + + 1 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 1 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + true + Script variable Python + 50f68354-3c25-4a84-a5f7-ddaf267be516 + trajectory + trajectory + true + 0 + true + e9d20ac9-0dbc-44cb-9f48-878ae446678f + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 1706 + 317 + 53 + 24 + + + 1734 + 329 + + + + + + + + Script output configs. + a4b043bc-8e30-4b4c-bb40-e7f42497696d + configs + configs + false + 0 + + + + + + 1789 + 317 + 45 + 24 + + + 1811.5 + 329 + + + + + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + a38644b3-ef3b-4bc2-bf1d-8843907a4a1f + Data + Pickup config + false + 02bc89eb-6961-419b-a5c7-ecf1d7beb296 + 1 + 2 + + + + + + 1591 + 300 + 78 + 20 + + + 1630.11 + 310.7518 + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + e9d20ac9-0dbc-44cb-9f48-878ae446678f + Data + Trajectory + false + bcf27a28-24e5-4d31-8438-444d7fe511cb + 1 + 2 + + + + + + 1591 + 324 + 61 + 20 + + + 1621.626 + 334.0815 + + + + + + + + + + 8ec86459-bf01-4409-baee-174d0d2b13d0 + Data + + + + + Contains a collection of generic data + 619d4216-bdfd-4395-b679-83b02e397c53 + Data + Robot + false + 4e66fe1b-29b3-4955-9524-ca986decd9ac + 1 + 2 + + + + + + 1591 + 275 + 50 + 20 + + + 1616.464 + 285.9058 + + + + + + + + + + c552a431-af5b-46a9-a8a4-0fcbc27ef596 + Group + + + + + 1 + + 150;240;218;146 + + A group of Grasshopper objects + ba94b074-3f68-4274-8b84-f87aa5c4cb3e + 01b0a494-be40-47b6-bdc4-7c92967b9f38 + 55db7485-e593-4762-a166-64303d976c7a + 97392278-c93e-4240-86e9-5e59dc2eb992 + 4a09e38e-e49b-43a1-809e-f310b5a4c3e2 + 1f8b3c58-8382-468d-8885-a179a0ad05e0 + 538c02c6-6b3b-4712-a784-dda0bc63f847 + c666c109-2ccb-4c50-90cd-00130af76eaa + 13b3eb29-3c6d-41ba-80fe-d6214ebc9674 + 9d4e5cda-5bb7-42fe-acfa-968fa6c6c067 + cd76efff-9d02-4eb1-b6dd-080d6a0e6d4d + bcf27a28-24e5-4d31-8438-444d7fe511cb + 12 + 4c3c7466-b1c2-4942-9ac0-63cb70a5b6b7 + Group + + + + + + + + + + + 59e0b89a-e487-49f8-bab8-b5bab16be14c + Panel + + + + + A panel for custom notes and text values + ecc8c71a-07d9-4980-90b1-a3cd2f8081a6 + Panel + + false + 0 + 0 + Define multiple target planes in any way you like, for example, +reference a curve from Rhino, divide it and assign a plane to each point + +Make sure all planes are oriented in a way that makes sense +for the robot to reach it as well. + + + + + + -530 + 485 + 523 + 96 + + 0 + 0 + 0 + + + + + 3 + + 255;255;250;90 + + true + true + true + false + false + true + + + + + Courier New + 8 + + + + + + + + + + + 59e0b89a-e487-49f8-bab8-b5bab16be14c + Panel + + + + + A panel for custom notes and text values + fb166dfc-4abf-4aa5-9ecf-d86922966dfe + Panel + + false + 0 + 0 + Define one pick-up plane in any way you like, +for example, reference a point from Rhino and assign a plane to it. + +Make sure the plane is oriented in a way that makes sense +for the robot to reach it. You can check this by observing the +results of the IK solution for this pickup-plane. + + + + + + -536 + 293 + 529 + 96 + + 0 + 0 + 0 + + -535.2353 + 293.4706 + + + + + + 3 + + 255;255;250;90 + + true + true + true + false + false + true + + + + + Courier New + 8 + + + + + + + + + + + 59e0b89a-e487-49f8-bab8-b5bab16be14c + Panel + + + + + A panel for custom notes and text values + c7cc41e4-23fe-4958-87c2-e75feb10ebac + Panel + + false + 0 + 0 + Load the robot from ROS. + +Make sure ROS/MoveIt is running before you start (ie. "Compose up"). + + + + + + -536 + 124 + 529 + 96 + + 0 + 0 + 0 + + -535.2353 + 124.4706 + + + + + + 3 + + 255;255;250;90 + + true + true + true + false + false + true + + + + + Courier New + 8 + + + + + + + + + + + 59e0b89a-e487-49f8-bab8-b5bab16be14c + Panel + + + + + A panel for custom notes and text values + 3f032319-94be-407d-8e0f-7615f6976834 + Panel + + false + 0 + 0 + Use inverse kinematics of the robot to find +a feasible configuration to reach the pickup plane. + +You can use the COMPAS FAB component or +code it in a GHPython component. + + + + + + -530 + 680 + 523 + 96 + + 0 + 0 + 0 + + -529.5882 + 680.8822 + + + + + + 3 + + 255;255;250;90 + + true + true + true + false + false + true + + + + + Courier New + 8 + + + + + + + + + + + 59e0b89a-e487-49f8-bab8-b5bab16be14c + Panel + + + + + A panel for custom notes and text values + 1f02a236-cf56-4437-8d21-1243b22a7b8e + Panel + + false + 0 + 0 + With the pickup config and a list of target planes, you are ready to compute the solution trajectory for each plane. + +First create a constraint from the selected plane, then use the plan free-space motion to calculate a trajectory. + + + + + + -530 + 942 + 523 + 96 + + 0 + 0 + 0 + + -529.353 + 942.6469 + + + + + + 3 + + 255;255;250;90 + + true + true + true + false + false + true + + + + + Courier New + 8 + + + + + + + + + + + 410755b1-224a-4c1e-a407-bf32fb45ea7e + 00000000-0000-0000-0000-000000000000 + ROS Connect + + + + + """ +Connect or disconnect to ROS. + +COMPAS FAB v0.27.0 +""" +from ghpythonlib.componentbase import executingcomponent as component +from scriptcontext import sticky as st + +from compas_fab.backends import RosClient +from compas_fab.ghpython.components import create_id + + +class ROSConnect(component): + def RunScript(self, ip, port, connect): + ros_client = None + + ip = ip or '127.0.0.1' + port = port or 9090 + + key = create_id(self, 'ros_client') + ros_client = st.get(key, None) + + if ros_client: + st[key].close() + if connect: + st[key] = RosClient(ip, port) + st[key].run(5) + + ros_client = st.get(key, None) + is_connected = ros_client.is_connected if ros_client else False + return (ros_client, is_connected) + + Connect or disconnect to ROS. +COMPAS FAB v0.27.0 + true + true + 2 + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEQAACxEBf2RfkQAAAdZJREFUSEu1lD2O4kAQRrkBcwP2BnADfARuABEhcAMcEEyCQKuVCCEkY27A3ADCyUAimQyHm/V+r9bNNp5iSLwtPWF/9dvdZRohhP+KK9aJK9aJK9aJKzpk4k08W4XYiB/CYquJPJbX6zVMp9PQbrcV0XhIt9sN6/VaIVZoQLyXMGVC8piYXwp5jMfj0Gq1zK/f7yvUVsdLGnkRBV0RlHT2/g2WHH+KonmJI4PD4ZA6HwVFPd9IR1hTzWZTj76Tcjay1Wr1QWIKnE6n0Ov17DnhXeSiWnTJbvHZ7/d3BkNrg3E2m/2OBbiH4XCITkLg+YhNnMVtakRuib0CWgMMYlMUxetutzPH8vwZ00f+HB8auznHe6CxagDdnMt3ztPOkunAWYsiPcF3YYxGo19ZloXtdvtT78d4b9yDVpEmf8Eg8qiJt7gLCi0WC9v2IxjV6Mu9aU3SAh2MYhI1wZaPBMcZfwadl8n5oqX8Sya7OZkhgSJoge1Xu04pE/Ot3E4hTUQBmyDB+d7ZBIU4f4INBmE+n3/meR4ul8tS2pe4+5e/91CURRjH7BuYIIYCX/vf8fgqaKYFHxEvz6CZh8nBFUGLQl7nN7y4Kq5YJ65YJ65YJ65YH6HxB7b14P1B22tpAAAAAElFTkSuQmCC + + false + 786e3858-73bf-4375-926e-9e755f637070 + true + true + ROS Connect + ROS + + + + + + 542 + 118 + 153 + 64 + + + 605 + 150 + + + + + + 3 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 2 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + true + The ip address ROS. Defaults to 127.0.0.1. + fd149db8-42df-4d8c-8370-a5b523504e45 + ip + ip + true + 0 + true + 0 + 37261734-eec7-4f50-b6a8-b8d1f3c4396b + + + + + + 544 + 120 + 46 + 20 + + + 568.5 + 130 + + + + + + + + true + The port of ROS. Defaults to 9090. + 57c708dc-00b9-451b-b29d-0cdc7abfb59d + port + port + true + 0 + true + 0 + 48d01794-d3d8-4aef-990e-127168822244 + + + + + + 544 + 140 + 46 + 20 + + + 568.5 + 150 + + + + + + + + true + If True, connects to ROS. If False, disconnects from ROS. Defaults to False. + 5cb47bc2-1f6c-4a2a-a643-6f55f5e538bd + connect + connect + true + 0 + true + c671349c-0a04-4b47-8c5b-11c4f1f32b68 + 1 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 544 + 160 + 46 + 20 + + + 568.5 + 170 + + + + + + + + The ROS client. + 4c4ce52a-2b18-43ff-a69c-27fe227e0298 + ros_client + ros_client + false + 0 + + + + + + 620 + 120 + 73 + 30 + + + 656.5 + 135 + + + + + + + + True if connection established. + 08869eb2-98a8-40b0-936f-d05666ccf68a + is_connected + is_connected + false + 0 + + + + + + 620 + 150 + 73 + 30 + + + 656.5 + 165 + + + + + + + + + + + + + + 410755b1-224a-4c1e-a407-bf32fb45ea7e + 00000000-0000-0000-0000-000000000000 + ROS Robot + + + + + """ +Load robot directly from ROS. + +COMPAS FAB v0.27.0 +""" +from compas_ghpython.artists import RobotModelArtist +from ghpythonlib.componentbase import executingcomponent as component +from scriptcontext import sticky as st + +from compas_fab.ghpython.components import create_id + + +class ROSRobot(component): + def RunScript(self, ros_client, load): + key = create_id(self, 'robot') + + if ros_client and ros_client.is_connected and load: + # Load URDF from ROS + st[key] = ros_client.load_robot(load_geometry=True, precision='12f') + st[key].artist = RobotModelArtist(st[key].model) + + robot = st.get(key, None) + if robot: # client sometimes need to be restarted, without needing to reload geometry + robot.client = ros_client + return robot + + Load robot directly from ROS. +COMPAS FAB v0.27.0 + true + true + 2 + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEQAACxEBf2RfkQAAAVtJREFUSEu9lMFRwzAQRVMCJaSElJASUgIlUAGTEhguXHPinBJSAiWkBDow/9n6ZmWtQzwYduaNpdVqtf5redN13Z+SOtckdS5B9iCeeKbrmXMJsrNg8CkOzXo1Gao5iYtg4z6uR2SP4iqY+Ans3Y5xk00sTjfsBcmOgbjOmMK2wvs/mgNKQL8o3sRzmb8Iy5BRySLbifHNpwsM3gWHvJY5ByAb44xKRtkoTz+vJkNiBn7CQXAIr29oqNd7OWTIhHxMrmNOD0oQb2EdSYL2VUUlDjlJ5kKQMDa8lahsdEPdNFfUHFLiiYsNJ766D9WG3lHLYy7TOCOjEArLi2gcQ7ATR2bvxC1yZ/7VjI1bQu4cXjt+KeaYxd8idQLJQmLDoelPbY7UaWTxCzGnLHaO1Glkv2546xhubUz2E8i2m+YxreP7Ji9htvmt4x8O4Ffhn9q93C/R2qTO9eg2XxfZxOCoCLXEAAAAAElFTkSuQmCC + + false + 2c1bc00f-0874-46d7-8825-0a59c936caf9 + true + true + ROS Robot + Robot + + + + + + 919 + 123 + 124 + 44 + + + 989 + 145 + + + + + + 2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 1 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + true + The ROS client. + 1f6b19eb-45ec-4254-8026-175b2c28094f + ros_client + ros_client + true + 0 + true + 4c4ce52a-2b18-43ff-a69c-27fe227e0298 + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 921 + 125 + 53 + 20 + + + 949 + 135 + + + + + + + + true + If True, loads the robot from ROS. Defaults to False. + 31365568-5652-47dc-a08f-9c19e9d37c39 + load + load + true + 0 + true + f303be99-5b98-410c-a704-212d2063c700 + 1 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 921 + 145 + 53 + 20 + + + 949 + 155 + + + + + + + + The robot. + db86a617-4f10-4df1-b030-ab74bd417a7b + robot + robot + false + 0 + + + + + + 1004 + 125 + 37 + 40 + + + 1022.5 + 145 + + + + + + + + + + + + + + 2e78987b-9dfb-42a2-8b76-3923ac8bd91a + Boolean Toggle + + + + + Boolean (true/false) toggle + c671349c-0a04-4b47-8c5b-11c4f1f32b68 + Boolean Toggle + Toggle + false + 0 + true + + + + + + 395 + 159 + 104 + 22 + + + + + + + + + + 2e78987b-9dfb-42a2-8b76-3923ac8bd91a + Boolean Toggle + + + + + Boolean (true/false) toggle + f303be99-5b98-410c-a704-212d2063c700 + Boolean Toggle + Toggle + false + 0 + true + + + + + + 790 + 144 + 104 + 22 + + + + + + + + + + fbac3e32-f100-4292-8692-77240a42fd1a + Point + + + + + Contains a collection of three-dimensional points + 5b03385c-4215-49ba-a2d2-e1601b8bf694 + Point + Pt + false + 0 + + + + + + 482 + 350 + 50 + 20 + + + 507.671 + 360.22 + + + + + + 1 + + + + + 1 + {0} + + + + + + + -0.0255648733674283 + 0.704182228873522 + 0.124600626356114 + + + + + + + + + + + + + + 17b7152b-d30d-4d50-b9ef-c9fe25576fc2 + XY Plane + + + + + World XY plane. + 0a318cdf-b5dc-412c-93a6-ee5867d777e7 + XY Plane + XY + + + + + + 557 + 345 + 65 + 31 + + + 589 + 361 + + + + + + Origin of plane + 6901e75b-a850-4a3e-80c3-e4ac88596e7f + Origin + O + false + 5b03385c-4215-49ba-a2d2-e1601b8bf694 + 1 + + + + + + 559 + 347 + 15 + 27 + + + 568 + 360.5 + + + + + + 1 + + + + + 1 + {0} + + + + + + + 0 + 0 + 0 + + + + + + + + + + + + World XY plane + fd6be31a-46fd-444b-b7e3-7c3307886499 + Plane + P + false + 0 + + + + + + 604 + 347 + 16 + 27 + + + 612 + 360.5 + + + + + + + + + + + + d5967b9f-e8ee-436b-a8ad-29fdcecf32d5 + Curve + + + + + Contains a collection of generic curves + 323e4ce0-804b-47bd-928e-602522184f0e + Curve + Crv + false + 0 + + + + + + 323 + 516 + 50 + 20 + + + 348 + 526.8 + + + + + + 1 + + + + + 1 + {0} + + + + + -1 + 7c7dddf6-8c9b-424b-a238-b292cbe83e40 + + + + + + + + + + + + + 2162e72e-72fc-4bf8-9459-d4d82fa8aa14 + Divide Curve + + + + + Divide a curve into equal length segments + 98889b2c-2851-4dab-854b-7acacfb89d93 + Divide Curve + Divide + + + + + + 437 + 514 + 65 + 64 + + + 469 + 546 + + + + + + Curve to divide + 2d3ad0b1-30c3-48f8-8f70-ad9d2832d4f4 + Curve + C + false + 323e4ce0-804b-47bd-928e-602522184f0e + 1 + + + + + + 439 + 516 + 15 + 20 + + + 448 + 526 + + + + + + + + Number of segments + ae45f8c1-7f33-4e88-acba-fa948d3e3838 + Count + N + false + 0 + + + + + + 439 + 536 + 15 + 20 + + + 448 + 546 + + + + + + 1 + + + + + 1 + {0} + + + + + 10 + + + + + + + + + + + Split segments at kinks + da401e60-2423-432e-b8a6-0491878ef29d + Kinks + K + false + 0 + + + + + + 439 + 556 + 15 + 20 + + + 448 + 566 + + + + + + 1 + + + + + 1 + {0} + + + + + false + + + + + + + + + + + 1 + Division points + cd242fa7-9b96-4489-a29a-ae9a3d1e8e0f + Points + P + false + 0 + + + + + + 484 + 516 + 16 + 20 + + + 492 + 526 + + + + + + + + 1 + Tangent vectors at division points + e6b2ac11-4a35-41ae-8fbf-fb47a54e5585 + Tangents + T + false + 0 + + + + + + 484 + 536 + 16 + 20 + + + 492 + 546 + + + + + + + + 1 + Parameter values at division points + 7fd66419-6d33-4cc1-a8f6-d03972b5dc1b + Parameters + t + false + 0 + + + + + + 484 + 556 + 16 + 20 + + + 492 + 566 + + + + + + + + + + + + 17b7152b-d30d-4d50-b9ef-c9fe25576fc2 + XY Plane + + + + + World XY plane. + c93dec70-7940-4332-a92e-239847b1ee0f + XY Plane + XY + + + + + + 526 + 511 + 65 + 31 + + + 558 + 527 + + + + + + Origin of plane + 285fe2bf-3938-4d58-9aca-2afd016b140b + Origin + O + false + cd242fa7-9b96-4489-a29a-ae9a3d1e8e0f + 1 + + + + + + 528 + 513 + 15 + 27 + + + 537 + 526.5 + + + + + + 1 + + + + + 1 + {0} + + + + + + + 0 + 0 + 0 + + + + + + + + + + + + World XY plane + 95db0851-9d34-4381-96f5-11096a60a10e + Plane + P + false + 0 + + + + + + 573 + 513 + 16 + 27 + + + 581 + 526.5 + + + + + + + + + + + + 410755b1-224a-4c1e-a407-bf32fb45ea7e + 00000000-0000-0000-0000-000000000000 + Inverse Kinematics + + + + + """ +Calculate the robot's inverse kinematic for a given plane. + +COMPAS FAB v0.27.0 +""" +from compas_rhino.conversions import RhinoPlane +from ghpythonlib.componentbase import executingcomponent as component + + +class InverseKinematics(component): + def RunScript(self, robot, plane, start_configuration, group): + configuration = None + if robot and robot.client and robot.client.is_connected and plane: + frame = RhinoPlane.from_geometry(plane).to_compas_frame() + configuration = robot.inverse_kinematics(frame, start_configuration, group) + return configuration + + Calculate the robot's inverse kinematic for a given plane. +COMPAS FAB v0.27.0 + true + true + 2 + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEQAACxEBf2RfkQAAAYFJREFUSEu1lLFxwzAMRVWn8gApNIKKDOAubbqk1AgeQRP4NIJG0AgqMoCq1BpBGzD/ywANkbAt3dm4eyfwkwBEElIRQngprvhMXHEL7+ff0tNTXFFBkhqMIAgz6MG3+AcvzuKKDJRETDqBFjSgE005efEWV0QgEzJBl+gs/CdzZLTzHpmAoEqCe9VgNWjePj5/oHMn3B13xnV37yITJEEMhH0BOsrqWLBuuQfYEVR2btFTAQEDmHQMawCdyTyZzCYeAAeEfrz8VXKC5Mv2dQzrJFALWDyNtDFeHQXJ0yOybzcD3scJWJ3YnQyazytQSoHlkmG6Az5XfQ9jMTosbIveLkCQnG2qBRg8p2tk7iDzHFhiI2RBFpi+YWzZFFgFRlnHYs1q3g5SYL0E1t78FlyRwLh9OiTr76344iW5Xq57/lvJhaIogZ6psunX7JEL11azH1H8cPaSC9fE/EW04se+3ksu5MdDbrbpI3Lh0tf246H/ki7iv+Xoze/BFZ9HKP4BuwtzfPsUblIAAAAASUVORK5CYII= + + false + 3e6837ef-0a8a-4e9c-a749-3a1f62ef0ec7 + true + true + Inverse Kinematics + IK + + + + + + 639 + 709 + 207 + 84 + + + 754 + 751 + + + + + + 4 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 1 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + true + The robot. + a2867d77-2f73-433a-9058-1a13bed40d9d + robot + robot + true + 0 + true + 98209ace-c305-4683-b351-d9b9daf31e36 + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + 2 + + + + + + 641 + 711 + 98 + 20 + + + 691.5 + 721 + + + + + + + + true + The plane or frame to calculate the inverse kinematic for. + 861f6f1a-72a3-4f42-96d4-53dddb1c82c0 + plane + plane + true + 0 + true + b96209a7-93e4-4212-b096-c83e82b4da7b + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 641 + 731 + 98 + 20 + + + 691.5 + 741 + + + + + + + + true + If passed, calculates the inverse such that the joint positions differ the least from the start_configuration. Defaults to the zero configuration. + 394b46e1-5c2c-407c-9a26-f12deef3300c + start_configuration + start_configuration + true + 0 + true + 0 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 641 + 751 + 98 + 20 + + + 691.5 + 761 + + + + + + + + true + The planning group used for calculation. Defaults to the robot's main planning group. + 82ee305b-f522-4325-bec8-c714afc18946 + group + group + true + 0 + true + 0 + 37261734-eec7-4f50-b6a8-b8d1f3c4396b + + + + + + 641 + 771 + 98 + 20 + + + 691.5 + 781 + + + + + + + + The planning group's configuration. + e722e2ce-e57b-4708-be92-6df9a6f144f0 + configuration + configuration + false + 0 + + + + + + 769 + 711 + 75 + 80 + + + 806.5 + 751 + + + + + + + + + + + + + + 3cd2949b-4ea8-4ffb-a70c-5c380f9f46ea + Deconstruct Plane + + + + + Deconstruct a plane into its component parts. + 4a56d682-c870-4078-9713-4261e29c26af + Deconstruct Plane + DePlane + + + + + + 847 + 318 + 65 + 84 + + + 877 + 360 + + + + + + Plane to deconstruct + 829871b4-f9c5-4467-be30-f7553bc65fd6 + Plane + P + false + fd6be31a-46fd-444b-b7e3-7c3307886499 + 1 + + + + + + 849 + 320 + 13 + 80 + + + 857 + 360 + + + + + + 1 + + + + + 1 + {0} + + + + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 0 + + + + + + + + + + + + Origin point + eb668489-34ac-4eb7-9c4d-989992e26bce + Origin + O + false + 0 + + + + + + 892 + 320 + 18 + 20 + + + 901 + 330 + + + + + + + + X-Axis vector + 751f2897-c1cb-40d0-bb23-8be90a8195d7 + X-Axis + X + false + 0 + + + + + + 892 + 340 + 18 + 20 + + + 901 + 350 + + + + + + + + Y-Axis vector + 12898737-9d04-4772-b783-9db2ae55df43 + Y-Axis + Y + false + 0 + + + + + + 892 + 360 + 18 + 20 + + + 901 + 370 + + + + + + + + Z-Axis vector + c6cb20ef-cea8-4f05-9adc-307379d82a3b + Z-Axis + Z + false + 0 + + + + + + 892 + 380 + 18 + 20 + + + 901 + 390 + + + + + + + + + + + + bc3e379e-7206-4e7b-b63a-ff61f4b38a3e + Construct Plane + + + + + Construct a plane from an origin point and {x}, {y} axes. + bb130d43-7571-400d-be95-d768d8588134 + Construct Plane + Pl + + + + + + 937 + 318 + 84 + 64 + + + 985 + 350 + + + + + + Origin of plane + 25a90b0a-1fcb-4405-a294-a2398429e199 + Origin + O + false + eb668489-34ac-4eb7-9c4d-989992e26bce + 1 + + + + + + 939 + 320 + 31 + 20 + + + 964 + 330 + + + + + + 1 + + + + + 1 + {0} + + + + + + + 0 + 0 + 0 + + + + + + + + + + + + X-Axis direction of plane + 7a5feec6-a344-42f4-b4e9-d60f3748b5f8 + -x + X-Axis + X + false + 751f2897-c1cb-40d0-bb23-8be90a8195d7 + 1 + + + + + + 939 + 340 + 31 + 20 + + + 964 + 350 + + + + + + 1 + + + + + 1 + {0} + + + + + + 1 + 0 + 0 + + + + + + + + + + + + Y-Axis direction of plane + 2af3cbd8-8f1f-468a-9d5a-66ee6bea29fa + Y-Axis + Y + false + 12898737-9d04-4772-b783-9db2ae55df43 + 1 + + + + + + 939 + 360 + 31 + 20 + + + 964 + 370 + + + + + + 1 + + + + + 1 + {0} + + + + + + 0 + 1 + 0 + + + + + + + + + + + + Constructed plane + e20789bc-7ff4-494c-89fb-ed8c0aa530b1 + Plane + Pl + false + 0 + + + + + + 1000 + 320 + 19 + 60 + + + 1009.5 + 350 + + + + + + + + + + + + 3cd2949b-4ea8-4ffb-a70c-5c380f9f46ea + Deconstruct Plane + + + + + Deconstruct a plane into its component parts. + a75955c3-1d1b-4d09-8b6c-28216e8fe162 + Deconstruct Plane + DePlane + + + + + + 783 + 484 + 65 + 84 + + + 813 + 526 + + + + + + Plane to deconstruct + 47ad2462-2190-4ac5-b421-34e636b0bcb0 + Plane + P + false + 95db0851-9d34-4381-96f5-11096a60a10e + 1 + + + + + + 785 + 486 + 13 + 80 + + + 793 + 526 + + + + + + 1 + + + + + 1 + {0} + + + + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 0 + + + + + + + + + + + + Origin point + d65106d4-e0d1-41d1-9396-a348ed1639cb + Origin + O + false + 0 + + + + + + 828 + 486 + 18 + 20 + + + 837 + 496 + + + + + + + + X-Axis vector + b303ceff-fc0e-40af-897d-44cb15e3ad4b + X-Axis + X + false + 0 + + + + + + 828 + 506 + 18 + 20 + + + 837 + 516 + + + + + + + + Y-Axis vector + b63c9f1c-f657-420b-a24d-d769e0d18206 + Y-Axis + Y + false + 0 + + + + + + 828 + 526 + 18 + 20 + + + 837 + 536 + + + + + + + + Z-Axis vector + 69869001-b90b-4f4c-9106-b1a3ec927156 + Z-Axis + Z + false + 0 + + + + + + 828 + 546 + 18 + 20 + + + 837 + 556 + + + + + + + + + + + + bc3e379e-7206-4e7b-b63a-ff61f4b38a3e + Construct Plane + + + + + Construct a plane from an origin point and {x}, {y} axes. + 60949651-3e13-46c5-8b12-42afb73519df + Construct Plane + Pl + + + + + + 882 + 484 + 84 + 64 + + + 930 + 516 + + + + + + Origin of plane + 4a6e656f-51b9-43dc-9abb-cfced7f3fc30 + Origin + O + false + d65106d4-e0d1-41d1-9396-a348ed1639cb + 1 + + + + + + 884 + 486 + 31 + 20 + + + 909 + 496 + + + + + + 1 + + + + + 1 + {0} + + + + + + + 0 + 0 + 0 + + + + + + + + + + + + X-Axis direction of plane + 1fda331b-b50e-4d6a-b074-ffe32b9ea8b7 + -x + X-Axis + X + false + b303ceff-fc0e-40af-897d-44cb15e3ad4b + 1 + + + + + + 884 + 506 + 31 + 20 + + + 909 + 516 + + + + + + 1 + + + + + 1 + {0} + + + + + + 1 + 0 + 0 + + + + + + + + + + + + Y-Axis direction of plane + c017cba9-3a08-485a-ac2e-c00f167b4b25 + Y-Axis + Y + false + b63c9f1c-f657-420b-a24d-d769e0d18206 + 1 + + + + + + 884 + 526 + 31 + 20 + + + 909 + 536 + + + + + + 1 + + + + + 1 + {0} + + + + + + 0 + 1 + 0 + + + + + + + + + + + + Constructed plane + b3cbcb2b-392a-479b-a624-1921bce18104 + Plane + Pl + false + 0 + + + + + + 945 + 486 + 19 + 60 + + + 954.5 + 516 + + + + + + + + + + + + 410755b1-224a-4c1e-a407-bf32fb45ea7e + 00000000-0000-0000-0000-000000000000 + Plan Motion + + + + + """ +Calculate a motion path. + +COMPAS FAB v0.27.0 +""" +from ghpythonlib.componentbase import executingcomponent as component +from scriptcontext import sticky as st + +from compas_fab.ghpython.components import create_id + + +class PlanMotion(component): + def RunScript(self, robot, goal_constraints, start_configuration, group, attached_collision_meshes, path_constraints, planner_id, compute): + + key = create_id(self, 'trajectory') + + path_constraints = list(path_constraints) if path_constraints else None + attached_collision_meshes = list(attached_collision_meshes) if attached_collision_meshes else None + planner_id = str(planner_id) if planner_id else 'RRTConnect' + + if robot and robot.client and robot.client.is_connected and start_configuration and goal_constraints and compute: + st[key] = robot.plan_motion(goal_constraints, + start_configuration=start_configuration, + group=group, + options=dict( + attached_collision_meshes=attached_collision_meshes, + path_constraints=path_constraints, + planner_id=planner_id, + )) + + trajectory = st.get(key, None) + return trajectory + + Calculate a motion path. +COMPAS FAB v0.27.0 + true + true + 2 + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEQAACxEBf2RfkQAAAY1JREFUSEu1lM1tAjEQhSmBDkgJFMCBEnKJuKYESuAQiRoicaADKIEOkgK455icckHK5n3e8WbsHRJAG0sfjOc9478xo6Zp/pUwOSRhckjC5LWojcVWHMRezDvNGz1qM7ETm0j3qL0KAk+a5NyAtTO+iQ3fZ7z3Ins9+6QHAybGpyDBj58sPgb+lWk1h6QHA14EP/gkZpZjEgJ2M6n8U9NqVkn3ZhuQV1ucvdqD4OjWPm9avQvuZJy0wPxuprR6l6dCCN593ul3Yg5Fvui0Z78UC583jTyBuqUGahwjiyt3XnTasiTorVKNydGXtWZ63nm63C5fdP4+hiOaiHZIcRD8OgHHwCTh41ILV2kaY4t7S/kuaC+JaoBHb3IedvAl6grj1RNAsbtsoJY/zJDZeqP58iPkLrr3YH2Ck/cnzQz8QRHUTHsD2h0QpFetxtt4Fhztruc3U77cmqKmzbsQTMJ9+HG9B5j86eOKHZifms8FQSKsrORNHxfewS38BBdU0S2EySEJk0MSJoejGX0DqCUOkgYB1loAAAAASUVORK5CYII= + + false + 58f93ed3-53c0-48c3-998c-1facd843dfea + true + true + Plan Motion + Plan Motion + + + + + + 928 + 927 + 224 + 164 + + + 1079 + 1009 + + + + + + 8 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 1 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + true + The robot. + 0d553e1a-ae49-4914-b1be-3e647df71f3d + robot + robot + true + 0 + true + 538c02c6-6b3b-4712-a784-dda0bc63f847 + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + 2 + + + + + + 930 + 929 + 134 + 20 + + + 998.5 + 939 + + + + + + + + 1 + true + The goal to be achieved, defined in a set of constraints. Constraints can be very specific, for example defining value domains for each joint, such that the goal configuration is included, or defining a volume in space, to which a specific robot link (e.g. the end-effector) is required to move to. + d1dc1dba-1f7c-4e52-805d-c3bc49980165 + goal_constraints + goal_constraints + true + 1 + true + 502683f8-68c4-4328-8096-d1ebe99ddcfe + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 930 + 949 + 134 + 20 + + + 998.5 + 959 + + + + + + + + true + The robot's full configuration, i.e. values for all configurable joints of the entire robot, at the starting position. Defaults to the all-zero configuration. + 5b865238-f6ba-4175-bdca-4bb873eecbb5 + start_configuration + start_configuration + true + 0 + true + c666c109-2ccb-4c50-90cd-00130af76eaa + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 930 + 969 + 134 + 20 + + + 998.5 + 979 + + + + + + + + true + The planning group used for calculation. Defaults to the robot's main planning group. + a2e2ed76-15a0-445d-87c9-1a2bf9be54bf + group + group + true + 0 + true + 0 + 37261734-eec7-4f50-b6a8-b8d1f3c4396b + + + + + + 930 + 989 + 134 + 20 + + + 998.5 + 999 + + + + + + + + 1 + true + A list of attached collision meshes to be included for planning. + 22ca4989-3027-4165-ae83-2271107c44fb + attached_collision_meshes + attached_collision_meshes + true + 1 + true + 0 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 930 + 1009 + 134 + 20 + + + 998.5 + 1019 + + + + + + + + 1 + true + Optional constraints that can be imposed along the solution path. Note that path calculation won't work if the start_configuration violates these constraints. Defaults to None. + 7c3f52f6-55e3-4c59-b6b9-343f7146ed3e + path_constraints + path_constraints + true + 1 + true + 0 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 930 + 1029 + 134 + 20 + + + 998.5 + 1039 + + + + + + + + true + The name of the algorithm used for path planning. Defaults to 'RRTConnect' + 9cfd177a-1e35-43de-b0e6-0c9923e31341 + planner_id + planner_id + true + 0 + true + 0 + 37261734-eec7-4f50-b6a8-b8d1f3c4396b + + + + + + 930 + 1049 + 134 + 20 + + + 998.5 + 1059 + + + + + + + + true + If True, calculates a trajectory. + 9b890791-6e01-4fe0-becf-99008f8ebadb + compute + compute + true + 0 + true + f039936d-451b-48ad-8b61-2bc187fd2bcc + 1 + d60527f5-b5af-4ef6-8970-5f96fe412559 + + + + + + 930 + 1069 + 134 + 20 + + + 998.5 + 1079 + + + + + + + + The calculated trajectory. + cee0f055-8a23-4e3a-a479-c3f2c06b24af + trajectory + trajectory + false + 0 + + + + + + 1094 + 929 + 56 + 160 + + + 1122 + 1009 + + + + + + + + + + + + + + 2e78987b-9dfb-42a2-8b76-3923ac8bd91a + Boolean Toggle + + + + + Boolean (true/false) toggle + f039936d-451b-48ad-8b61-2bc187fd2bcc + Boolean Toggle + Toggle + false + 0 + true + + + + + + 789 + 1068 + 104 + 22 + + + + + + + + + + 410755b1-224a-4c1e-a407-bf32fb45ea7e + 00000000-0000-0000-0000-000000000000 + Constraints From Plane + + + + + """ +Create a position and an orientation constraint from a plane calculated for the group's end-effector link. + +COMPAS FAB v0.27.0 +""" +import math + +from compas_rhino.conversions import RhinoPlane +from ghpythonlib.componentbase import executingcomponent as component + + +class ConstraintsFromPlane(component): + def RunScript(self, robot, plane, group, tolerance_position, tolerance_xaxis, tolerance_yaxis, tolerance_zaxis): + goal_constraints = None + if robot and plane: + tolerance_position = tolerance_position or 0.001 + tolerance_xaxis = tolerance_xaxis or 1. + tolerance_yaxis = tolerance_yaxis or 1. + tolerance_zaxis = tolerance_zaxis or 1. + + frame = RhinoPlane.from_geometry(plane).to_compas_frame() + tolerances_axes = [math.radians(tolerance_xaxis), math.radians(tolerance_yaxis), math.radians(tolerance_zaxis)] + goal_constraints = robot.constraints_from_frame(frame, tolerance_position, tolerances_axes, group) + + return goal_constraints + + Create a position and an orientation constraint from a plane calculated for the group's end-effector link. +COMPAS FAB v0.27.0 + true + true + 2 + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEAAACxABrSO9dQAAAd9JREFUSEu1lTFLw0AYho92ENShVFHE1p4ILipkcBXqDxA6OQfHThn8ARk7OBQdXfIPzOyUwUFwKfgHSifBJU7idL7f9S7ctV+bVHB4yN17+Z4vuZxVKKX+FTacRYjnBpdXgQ1dIJdgyK1VgQ1dIA/BiFurAhu6QJ4CDP62TWzoAnFuGvS49TLY0AJpYOREwt1TBhtaII2cBmPunjLY0AJp5jQgJHffMtjQBdIYZNxaFdjQZVmDo44MwdLmbEi8CNGl66Z4GqzV0zcai0fRBcVxhTwGGM7XW9gQ8hAoMLhpXXyLIFYQJ2ACRvKk3Yd4RHJDDhIw9428CeHILUnzTvQhzoHaudqeSqWc4Jrp8VRuGwWur0xORBA3wNfG7bqWU5P6fe398PhgQHOqxbVrGng/K4vkOUhNpl8bDXqds9Zn57T9U3uo0Zaprevmh21AYBzRHBR/9VbeAxmIgPeKBAro6fQHBa9oNNy73E3b5/u6gVkj9BsB2rqYaj3RIkyx3p5VoFpWuAgU0R4X5x5j75hiTG9K8shmRXEVUDg0gtDMZxvYo6u/G+EJykBhA4yNhOS2IT25lRdPT3iCKkAggT3/LrR9npzwJqsAWQBsI/pNYv/jzQWrAKk+vtzaFCV+ASnZhhTkLZwXAAAAAElFTkSuQmCC + + false + 5d6185e1-fb6b-437b-88e9-e9bee2715432 + true + true + Constraints From Plane + Constraints From Plane + + + + + + 367 + 1165 + 193 + 144 + + + 480 + 1237 + + + + + + 7 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 84fa917c-1ed8-4db3-8be1-7bdc4a6495a2 + 1 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + true + The robot. + 38d9a35b-28a5-4a71-a5ba-701265ae7cfa + robot + robot + true + 0 + true + 538c02c6-6b3b-4712-a784-dda0bc63f847 + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + 2 + + + + + + 369 + 1167 + 96 + 20 + + + 418.5 + 1177 + + + + + + + + true + The plane or frame from which we create position and orientation constraints. + b08d0c2c-8b7e-4004-8d6d-938817b7953c + plane + plane + true + 0 + true + 492e755f-6ed7-4b1a-9482-feeb1574a2ae + 1 + 87f87f55-5b71-41f4-8aea-21d494016f81 + + + + + + 369 + 1187 + 96 + 20 + + + 418.5 + 1197 + + + + + + + + true + The planning group for which we specify the constraint. Defaults to the robot's main planning group. + c40540a5-37a0-492d-b76c-84de4642fcc9 + group + group + true + 0 + true + 0 + 37261734-eec7-4f50-b6a8-b8d1f3c4396b + + + + + + 369 + 1207 + 96 + 20 + + + 418.5 + 1217 + + + + + + + + true + The allowed tolerance to the frame's position (defined in the robot's units). Defaults to 0.001 + 88f4f014-ccb2-4456-8098-fdaee1195db1 + tolerance_position + tolerance_position + true + 0 + true + 0 + 39fbc626-7a01-46ab-a18e-ec1c0c41685b + + + + + + 369 + 1227 + 96 + 20 + + + 418.5 + 1237 + + + + + + + + true + The allowed tolerance of the frame's X-axis in degrees. + 0d94265f-7ef6-426f-8f65-b16334052668 + tolerance_xaxis + tolerance_xaxis + true + 0 + true + 0 + 39fbc626-7a01-46ab-a18e-ec1c0c41685b + + + + + + 369 + 1247 + 96 + 20 + + + 418.5 + 1257 + + + + + + + + true + The allowed tolerance of the frame's Y-axis in degrees. + 3eabb6eb-a4bb-4e94-b015-c603c995bbb8 + tolerance_yaxis + tolerance_yaxis + true + 0 + true + 0 + 39fbc626-7a01-46ab-a18e-ec1c0c41685b + + + + + + 369 + 1267 + 96 + 20 + + + 418.5 + 1277 + + + + + + + + true + The allowed tolerance of the frame's Z-axis in degrees. + 516d2f83-2488-43a9-a755-52d8df6c836f + tolerance_zaxis + tolerance_zaxis + true + 0 + true + 0 + 39fbc626-7a01-46ab-a18e-ec1c0c41685b + + + + + + 369 + 1287 + 96 + 20 + + + 418.5 + 1297 + + + + + + + + A list containing a position and an orientation constraint. + 502683f8-68c4-4328-8096-d1ebe99ddcfe + constraints + constraints + false + 0 + + + + + + 495 + 1167 + 63 + 140 + + + 526.5 + 1237 + + + + + + + + + + + + + + 59daf374-bc21-4a5e-8282-5504fb7ae9ae + List Item + + + + + 0 + Retrieve a specific item from a list. + b0c711fd-5445-4ec3-b741-f9857668c727 + List Item + Item + + + + + + 245 + 1165 + 64 + 64 + + + 279 + 1197 + + + + + + 3 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + 2e3ab970-8545-46bb-836c-1c11e5610bce + cb95db89-6165-43b6-9c41-5702bc5bf137 + 1 + 8ec86459-bf01-4409-baee-174d0d2b13d0 + + + + + 1 + Base list + 9a80dbc0-b1c8-4f41-97e6-8bc629a092b3 + List + L + false + 55db7485-e593-4762-a166-64303d976c7a + 1 + + + + + + 247 + 1167 + 17 + 20 + + + 257 + 1177 + + + + + + + + Item index + ef84aa81-d4cc-4b5a-b93d-fd38ece56ab2 + Index + i + false + ce6bc35e-5dfc-4d8b-a809-20b7af9d2b4c + 1 + + + + + + 247 + 1187 + 17 + 20 + + + 257 + 1197 + + + + + + 1 + + + + + 1 + {0} + + + + + 0 + + + + + + + + + + + Wrap index to list bounds + e4f9687b-f17c-4305-9423-a64ac877c823 + Wrap + W + false + 0 + + + + + + 247 + 1207 + 17 + 20 + + + 257 + 1217 + + + + + + 1 + + + + + 1 + {0} + + + + + true + + + + + + + + + + + Item at {i'} + 492e755f-6ed7-4b1a-9482-feeb1574a2ae + false + Item + i + false + 0 + + + + + + 294 + 1167 + 13 + 60 + + + 300.5 + 1197 + + + + + + + + + + + + + + 57da07bd-ecab-415d-9d86-af36d7073abc + Number Slider + + + + + Numeric slider for single values + ce6bc35e-5dfc-4d8b-a809-20b7af9d2b4c + Number Slider + + false + 0 + + + + + + 53 + 1187 + 176 + 20 + + + 53.99999 + 1187.4 + + + + + + 3 + 1 + 1 + 10 + 0 + 0 + 7 + + + + + + + + + 2fcc2743-8339-4cdf-a046-a1f17439191d + Remap Numbers + + + + + Remap numbers into a new numeric domain + true + e7c4bf23-3de8-4791-b46f-7d3f3ceb76d8 + Remap Numbers + ReMap + + + + + + 2097 + 438 + 65 + 64 + + + 2128 + 470 + + + + + + Value to remap + 58fd8d0f-443c-4d4c-a9e3-5e337f0f9aec + Value + V + false + e4b338fe-125d-4929-92e1-4e17c08f9b3b + 1 + + + + + + 2099 + 440 + 14 + 20 + + + 2107.5 + 450 + + + + + + + + Source domain + 2ddde02e-cf5b-4ca1-82b2-4dea157c548a + Source + S + false + 0 + + + + + + 2099 + 460 + 14 + 20 + + + 2107.5 + 470 + + + + + + 1 + + + + + 1 + {0} + + + + + + 0 + 100 + + + + + + + + + + + + Target domain + 163a03bf-8819-45c6-8584-c58f76c7ce59 + Target + T + false + 8f610b3f-fd83-49e0-8c49-d41810792216 + 1 + + + + + + 2099 + 480 + 14 + 20 + + + 2107.5 + 490 + + + + + + 1 + + + + + 1 + {0} + + + + + + 0 + 1 + + + + + + + + + + + + Remapped number + b7563f7c-f296-42be-9f19-e12c3a812f51 + Mapped + R + false + 0 + + + + + + 2143 + 440 + 17 + 30 + + + 2151.5 + 455 + + + + + + + + Remapped and clipped number + 701f27e6-7d26-47f4-aa6c-6ffdaca132e0 + Clipped + C + false + 0 + + + + + + 2143 + 470 + 17 + 30 + + + 2151.5 + 485 + + + + + + + + + + + + 1817fd29-20ae-4503-b542-f0fb651e67d7 + List Length + + + + + Measure the length of a list. + true + d792e015-00bc-4072-a93f-f11bc2ea4437 + List Length + Lng + + + + + + 1922 + 481 + 61 + 38 + + + 1951 + 500 + + + + + + 1 + Base list + afe61887-c91b-4045-a27f-681c59479f18 + List + L + false + ddfd1927-535b-4f08-acf1-f1762fa62a54 + 1 + + + + + + 1924 + 483 + 12 + 34 + + + 1931.5 + 500 + + + + + + + + Number of items in L + b4bfb4ae-ec2e-4dbc-b253-af059881c12c + Length + L + false + 0 + + + + + + 1966 + 483 + 15 + 34 + + + 1973.5 + 500 + + + + + + + + + + + + d1a28e95-cf96-4936-bf34-8bf142d731bf + Construct Domain + + + + + Create a numeric domain from two numeric extremes. + true + ff50b778-f2b0-477e-a8fd-beb8ee07e77e + Construct Domain + Dom + + + + + + 1996 + 468 + 77 + 45 + + + 2043 + 491 + + + + + + Start value of numeric domain + a775e54a-99fe-4f19-a952-a8f1d682387c + Domain start + A + false + 0 + + + + + + 1998 + 470 + 30 + 20 + + + 2022.5 + 480.25 + + + + + + 1 + + + + + 1 + {0} + + + + + 0 + + + + + + + + + + + End value of numeric domain + e8916671-bd35-42a9-80e5-456ebb1adfef + x-1 + Domain end + B + false + b4bfb4ae-ec2e-4dbc-b253-af059881c12c + 1 + + + + + + 1998 + 490 + 30 + 21 + + + 2022.5 + 500.75 + + + + + + 1 + + + + + 1 + {0} + + + + + 1 + + + + + + + + + + + Numeric domain between {A} and {B} + 8f610b3f-fd83-49e0-8c49-d41810792216 + Domain + I + false + 0 + + + + + + 2058 + 470 + 13 + 41 + + + 2064.5 + 490.5 + + + + + + + + + + + + + + + \ No newline at end of file