Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 154 additions & 44 deletions freecad/cross/init_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,91 @@
from .wb_utils import ICON_PATH
from . import wb_constants

######
###########
# link commands
#######
#############
class link_command_group:
def __init__(self):
pass
def GetCommands(self):
return (
'NewLink', # Defined in ./ui/command_new_link.py.
'NewLinksFilled', # Defined in ./ui/command_new_links_filled.py.))
)

def GetResources(self):
return {'MenuText': "create link", 'ToolTip': "Link commands"}
fcgui.addCommand("NewLinkCommandGroup",link_command_group())

#####
########
# joint commands
####
##########
class joint_command_group:
def __init__(self):
pass
def GetCommands(self):
return (
'NewJoint', # Defined in ./ui/command_new_joint.py.
'NewJointsFilled', # Defined in ./ui/command_new_joints_filled.py.
'NewJointsFilledSpider', # Defined in ./ui/command_new_joints_filled_spider_connect.py.
)

def GetResources(self):
return {'MenuText':"create joint", 'ToolTip': "Joint Commands"}
fcgui.addCommand("NewJointCommandGroup",joint_command_group())
#############
####
# placement commands
###############
class placement_command_group:
def __init__(self):
pass
def GetCommands(self):
return (
'SetCROSSPlacementFast', # Defined in ./ui/command_set_placement_fast.py.
'SetCROSSPlacementFastChildToParent', # Defined in ./ui/command_set_placement_fast_child_to_parent.py.
'SetCROSSPlacementFastParentToChild', # Defined in ./ui/command_set_placement_fast_parent_to_child.py.
'SetCROSSPlacementInAbsoluteCoordinates', # Defined in ./ui/command_set_placement_in_absolute_coordinates.py.
'SetCROSSPlacementByOrienteer', # Defined in ./ui/command_set_placement_by_orienteer.py.
'SetCROSSPlacementByOrienteerWithHoldChain', # Defined in ./ui/command_set_placement_by_orienteer_with_hold_chain.py.
'SetCROSSPlacementFastSensor', # Defined in ./ui/command_set_placement_fast_sensor.py.
)

def GetResources(self):

return {'MenuText': "set Placement", 'ToolTip':"placement commands"}

fcgui.addCommand("NewPlacementCommandGroup",placement_command_group())

# ######
# #############################
# export and import
#####
class export_command_group:
def __init__(self):
pass
def GetCommands(self):
return (
'UrdfImport', # Defined in ./ui/command_robot_from_urdf.py.
'AssemblyFromUrdf', # Defined in ./ui/command_assembly_from_urdf.py.
'UrdfExport', # Defined in ./ui/command_urdf_export.py.
'TransferProjectToExternalCodeGenerator', # Defined in ./ui/command_transfer_project_to_external_code_generator.py.
)

def GetResources(self):
return {'MenuText':"export n import", 'ToolTip': "export n import commands"}
fcgui.addCommand("ExportCommandGroup",export_command_group())

############
#############
#########################
# workbench
############
######
class CrossWorkbench(fcgui.Workbench):
"""Class which gets initiated at startup of the GUI."""

Expand All @@ -73,60 +157,90 @@ def Initialize(self):

"""
# The order here defines the order of the icons in the GUI.
toolbar_commands = [
creation_n_editing=[
# Creation and editing.
'NewRobot', # Defined in ./ui/command_new_robot.py.
'ExplodeLinks', # Defined in ./ui/command_explode_links.py.
'NewLink', # Defined in ./ui/command_new_link.py.
'NewLinksFilled', # Defined in ./ui/command_new_links_filled.py.
'NewJoint', # Defined in ./ui/command_new_joint.py.
'NewJointsFilled', # Defined in ./ui/command_new_joints_filled.py.
'NewJointsFilledSpider', # Defined in ./ui/command_new_joints_filled_spider_connect.py.
"NewLinkCommandGroup",
'NewLCSAtRobotLinkBody', # Defined in ./ui/command_new_lcs_at_robot_link_body.py.
"NewJointCommandGroup",
'NewController', # Defined in ./ui/command_new_controller.py.
'NewSensor', # Defined in ./ui/command_new_sensor.py.
'OpenModelsLibrary', # Defined in ./ui/command_open_models_library.py.
'NewWorkcell', # Defined in ./ui/command_new_workcell.py.
'NewXacroObject', # Defined in ./ui/command_new_xacro_object.py.
'NewLCSAtRobotLinkBody', # Defined in ./ui/command_new_lcs_at_robot_link_body.py.
'SetCROSSPlacementFast', # Defined in ./ui/command_set_placement_fast.py.
'SetCROSSPlacementFastChildToParent', # Defined in ./ui/command_set_placement_fast_child_to_parent.py.
'SetCROSSPlacementFastParentToChild', # Defined in ./ui/command_set_placement_fast_parent_to_child.py.
'SetCROSSPlacementInAbsoluteCoordinates', # Defined in ./ui/command_set_placement_in_absolute_coordinates.py.
'SetCROSSPlacementByOrienteer', # Defined in ./ui/command_set_placement_by_orienteer.py.
'SetCROSSPlacementByOrienteerWithHoldChain', # Defined in ./ui/command_set_placement_by_orienteer_with_hold_chain.py.
'SetCROSSPlacementFastSensor', # Defined in ./ui/command_set_placement_fast_sensor.py.
# 'SetCROSSPlacement', # Defined in ./ui/command_set_placement.py.
'KKEdit', # Defined in ./ui/command_kk_edit.py.

]
self.appendToolbar("creation n editing",creation_n_editing)
creating_n_editing_ext=creation_n_editing=[
'DuplicateRobot', # Defined in ./ui/command_duplicate_robot.py.
]
placement=[
"NewPlacementCommandGroup",
'RotateJointX', # Defined in ./ui/command_rotate_joint_x.py.
'RotateJointY', # Defined in ./ui/command_rotate_joint_y.py.
'RotateJointZ', # Defined in ./ui/command_rotate_joint_z.py.
]
self.appendToolbar("placement",placement)
collision=[
'BoxFromBoundingBox', # Defined in ./ui/command_box_from_bounding_box.py.
'SphereFromBoundingBox', # Defined in ./ui/command_sphere_from_bounding_box.py.
'ZAlignedCylinderFromBoundingBox', # Defined in ./ui/command_cylinder_z_aligned_from_bounding_box.py.
'XAlignedCylinderFromBoundingBox', # Defined in ./ui/command_cylinder_x_aligned_from_bounding_box.py.
'YAlignedCylinderFromBoundingBox', # Defined in ./ui/command_cylinder_y_aligned_from_bounding_box.py.
'CreateCollisionCopyObj', # Defined in ./ui/command_create_collision_copy_obj.py.
# 'SimplifyMesh', # Defined in ./ui/command_simplify_mesh.py.
]
self.appendToolbar("collision",collision)
live_debugging=[
# "Live" debugging.
'GetPlanningScene', # Defined in ./ui/command_get_planning_scene.py.
'UpdatePlanningScene', # Defined in ./ui/command_update_planning_scene.py.
'NewAttachedCollisionObject', # Defined in ./ui/command_new_attached_collision_object.py.
'NewPose', # Defined in ./ui/command_new_pose.py.
'NewTrajectory', # Defined in ./ui/command_new_trajectory.py.
'KKEdit', # Defined in ./ui/command_kk_edit.py.
'SetJoints', # Defined in ./ui/command_set_joints.py.
]
mesh_simplification=[
# Mesh simplification.
'SimplifyMesh', # Defined in ./ui/command_simplify_mesh.py.
'Separator',
]
physical_properties=[
'SetMaterial', # Defined in ./ui/command_set_material.py.
'CalculateMassAndInertia', # Defined in ./ui/command_calculate_mass_and_inertia.py.
]
self.appendToolbar("Physical properties",physical_properties)
import_n_export=[
# Import / export.
"ExportCommandGroup"
]
self.appendToolbar("world",[
'WorldGenerator', # Defined in ./ui/command_world_generator.py.
'UrdfImport', # Defined in ./ui/command_robot_from_urdf.py.
'AssemblyFromUrdf', # Defined in ./ui/command_assembly_from_urdf.py.
'UrdfExport', # Defined in ./ui/command_urdf_export.py.
'TransferProjectToExternalCodeGenerator', # Defined in ./ui/command_transfer_project_to_external_code_generator.py.
])
self.appendToolbar("import n export",import_n_export)
settings=[
# Workbench settings.
'WbSettings', # Defined in ./ui/command_wb_settings.py.
]
self.appendToolbar("settings",settings)
Development=[
'Reload', # Comment out to disable this developer tool.
]
self.appendToolbar('RobotCAD', toolbar_commands)

self.appendToolbar("Development",Development)
# Same as commands but with NewObserver and without Reload.
menu_commands = [
# Creation and editing.
# Mesh simplification.
'SimplifyMesh', # Defined in ./ui/command_simplify_mesh.py.
'WorldGenerator', # Defined in ./ui/command_world_generator.py.
# Workbench settings.
'WbSettings', # Defined in ./ui/command_wb_settings.py.
'Separator',
]
self.appendMenu('RobotCAD', menu_commands)
self.appendMenu(['RobotCAD',"Create_n_edit"],[
# Creation and editing.
'NewRobot', # Defined in ./ui/command_new_robot.py.
'ExplodeLinks', # Defined in ./ui/command_explode_links.py.
'NewLink', # Defined in ./ui/command_new_link.py.
Expand All @@ -141,7 +255,8 @@ def Initialize(self):
'NewXacroObject', # Defined in ./ui/command_new_xacro_object.py.
'KKEdit', # Defined in ./ui/command_kk_edit.py.
'DuplicateRobot', # Defined in ./ui/command_duplicate_robot.py.
'Separator',
])
self.appendMenu(['RobotCAD',"Placement"],[
# Placement
'NewLCSAtRobotLinkBody', # Defined in ./ui/command_new_lcs_at_robot_link_body.py.
'SetCROSSPlacementFast', # Defined in ./ui/command_set_placement_fast.py.
Expand All @@ -151,21 +266,25 @@ def Initialize(self):
'SetCROSSPlacementByOrienteer', # Defined in ./ui/command_set_placement_by_orienteer.py.
'SetCROSSPlacementByOrienteerWithHoldChain', # Defined in ./ui/command_set_placement_by_orienteer_with_hold_chain.py.
'SetCROSSPlacementFastSensor', # Defined in ./ui/command_set_placement_fast_sensor.py.
'SetCROSSPlacement', # Defined in ./ui/command_set_placement.py.
'RotateJointX', # Defined in ./ui/command_rotate_joint_x.py.
'RotateJointY', # Defined in ./ui/command_rotate_joint_y.py.
'RotateJointZ', # Defined in ./ui/command_rotate_joint_z.py.
'Separator',
# Collisions
])
self.appendMenu(["RobotCAD","Collisions"],[
# Collisions
'BoxFromBoundingBox', # Defined in ./ui/command_box_from_bounding_box.py.
'SphereFromBoundingBox', # Defined in ./ui/command_sphere_from_bounding_box.py.
'ZAlignedCylinderFromBoundingBox', # Defined in ./ui/command_cylinder_z_aligned_from_bounding_box.py.
'XAlignedCylinderFromBoundingBox', # Defined in ./ui/command_cylinder_x_aligned_from_bounding_box.py.
'YAlignedCylinderFromBoundingBox', # Defined in ./ui/command_cylinder_y_aligned_from_bounding_box.py.
'CreateCollisionCopyObj', # Defined in ./ui/command_create_collision_copy_obj.py.
# Mesh simplification.
'SimplifyMesh', # Defined in ./ui/command_simplify_mesh.py.
'Separator',
])
self.appendMenu(["RobotCAD","Material Properties"],[
# Definition of inertial properties.
'SetMaterial', # Defined in ./ui/command_set_material.py.
'CalculateMassAndInertia', # Defined in ./ui/command_calculate_mass_and_inertia.py.
])
self.appendMenu(["RobotCAD","debugging"],[
# "Live" debugging.
'GetPlanningScene', # Defined in ./ui/command_get_planning_scene.py.
'UpdatePlanningScene', # Defined in ./ui/command_update_planning_scene.py.
Expand All @@ -175,23 +294,14 @@ def Initialize(self):
'NewObserver', # Defined in ./ui/command_new_observer.py.
'SetJoints', # Defined in ./ui/command_set_joints.py.
'Separator',
# Definition of inertial properties.
'SetMaterial', # Defined in ./ui/command_set_material.py.
'CalculateMassAndInertia', # Defined in ./ui/command_calculate_mass_and_inertia.py.
'Separator',
# Import / export.
])
self.appendMenu(["RobotCAD","Import_n_export"],[
# Import / export.
'UrdfImport', # Defined in ./ui/command_robot_from_urdf.py.
'AssemblyFromUrdf', # Defined in ./ui/command_assembly_from_urdf.py.
'UrdfExport', # Defined in ./ui/command_urdf_export.py.
'WorldGenerator', # Defined in ./ui/command_world_generator.py.
'TransferProjectToExternalCodeGenerator', # Defined in ./ui/command_transfer_project_to_external_code_generator.py.
'Separator',
# Workbench settings.
'WbSettings', # Defined in ./ui/command_wb_settings.py.
]

self.appendMenu('RobotCAD', menu_commands)

])
fcgui.addIconPath(str(ICON_PATH))
# fcgui.addLanguagePath(joinDir('Resources/translations'))

Expand Down
2 changes: 1 addition & 1 deletion modules/robot_descriptions
Submodule robot_descriptions updated 40 files
+7 −12 .github/ISSUE_TEMPLATE/feature_request.md
+0 −1 .github/workflows/test.yml
+2 −72 CHANGELOG.md
+2 −16 CITATION.cff
+26 −48 README.md
+1 −1 examples/show_in_mujoco.py
+1 −1 robot_descriptions/__init__.py
+0 −28 robot_descriptions/__main__.py
+2 −36 robot_descriptions/_descriptions.py
+3 −51 robot_descriptions/_repositories.py
+0 −21 robot_descriptions/adam_lite_mj_description.py
+0 −21 robot_descriptions/bambot_description.py
+0 −21 robot_descriptions/booster_t1_description.py
+0 −21 robot_descriptions/booster_t1_mj_description.py
+0 −20 robot_descriptions/dynamixel_2r_mj_description.py
+1 −1 robot_descriptions/g1_description.py
+0 −2 robot_descriptions/g1_mj_description.py
+0 −30 robot_descriptions/gr1_description.py
+0 −20 robot_descriptions/h1_2_description.py
+0 −20 robot_descriptions/h1_2_mj_description.py
+1 −1 robot_descriptions/h1_description.py
+0 −0 robot_descriptions/leap_hand_v1.py
+1 −14 robot_descriptions/loaders/yourdfpy.py
+0 −21 robot_descriptions/low_cost_robot_arm_mj_description.py
+0 −20 robot_descriptions/mujoco_humanoid_mj_description.py
+0 −18 robot_descriptions/n1_description.py
+0 −20 robot_descriptions/n1_mj_description.py
+1 −1 robot_descriptions/piper_mj_description.py
+0 −21 robot_descriptions/rby1_description.py
+0 −21 robot_descriptions/rby1_mj_description.py
+0 −21 robot_descriptions/rsk_mj_description.py
+6 −2 robot_descriptions/so_arm100.py
+0 −20 robot_descriptions/so_arm101_description.py
+0 −20 robot_descriptions/so_arm101_mj_description.py
+0 −20 robot_descriptions/tiago++_mj_description.py
+0 −22 robot_descriptions/toddlerbot_description.py
+0 −21 robot_descriptions/wl_p311d_description.py
+0 −21 robot_descriptions/wl_p311e_description.py
+0 −21 robot_descriptions/yam_description.py
+0 −21 robot_descriptions/yam_mj_description.py
2 changes: 1 addition & 1 deletion modules/ros2_controllers
Submodule ros2_controllers updated 205 files