├── API docs └── 2017_09a API Help_FusionAPI.chm ├── README.md └── urdf_generator ├── mypackage ├── CMakeLists.txt ├── components │ ├── base0.stp │ ├── link10.stp │ ├── link11.stp │ ├── link20.stp │ ├── link30.stp │ ├── link40.stp │ └── link50.stp ├── display.launch ├── meshes │ ├── base.stl │ ├── link1.stl │ ├── link2.stl │ ├── link3.stl │ ├── link4.stl │ └── link5.stl ├── package.xml ├── robot.urdf └── urdf_.rviz ├── resources ├── CMakeLists.txt ├── display.launch ├── package.xml └── urdf_.rviz └── urdf-addin.py /API docs/2017_09a API Help_FusionAPI.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GummiArmCE/fusion360_scripts/59288c2f43f360a99572d71239cc612703574a73/API docs/2017_09a API Help_FusionAPI.chm -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fusion360_scripts 2 | 3 | Scripts that utilise the Fusion 360 API: URDF generation, and open-source CAD-file version control. 4 | 5 | 6 | ## URDF Generator: 7 | 8 | You need to load it as an Add-in and set it to run. It runs in Fusion as a new command, so it needs to be done this way. 9 | 10 | The sequence to create the urdf is: 11 | 12 | 1 - add links or joints from button 13 | 14 | 2 - press the select button to start working with that element. This will update the selection tool to either the joint or occurrences. 15 | 16 | 3 - press the selection button to select either one or more occurrences (when building a link) or one joint (when building a joint) 17 | 18 | 4 - for joints you also need to set up parent and child, which should already be on the table (or they won't show up in the droplist) 19 | 20 | 5 - review what you did by clicking on the "Select" button again on the element you've just created. The information about it should change to: 21 | 22 | In case it is a link: 23 | 24 | current element: XXXX <- your linkname 25 | List of assembly elements that this link contains <- this is the group 26 | .... 27 | 28 | List of links/joints already present in urdftree. 29 | .... 30 | 31 | 32 | In case it is a joint: 33 | 34 | current element: YYYY <- your jointname 35 | genjn: WWWW <- the name of the joint from the assembly that lends its properties to the URDF joint we will create 36 | parent: XXXX child: ZZZZ <- the names of the links who are parent and child references for that joint, respectively 37 | 38 | List of links/joints already present in urdftree. 39 | .... 40 | 41 | 42 | 6 - Finally, before clicking OK, you need to run "Create Tree". This will parse all elements (joints and links), to check whether you have actually build a linkage tree (at this moment it only checks for disconnected elements and links with empty groups, but that's the idea anyway). 43 | 44 | When all of this is done and you are satisfied with your results, click OK. This will create new documents for each link you created (they should be centred and all put together nicely), create a new directory where you set it to be created, with the name that you defined (the default is mypackage) on the interface and set-up a pretty basic ros package definition. 45 | 46 | If you have rviz installed, you can use the display.launch file provided and see what you have done with: 47 | 48 | roslaunch mypackage display.launch 49 | 50 | This will start rviz and robot and joint state publisher so you can move it around. 51 | 52 | A sample of a created urdf using this add-in is available in the mypackage folder. 53 | 54 | ### Caveats: 55 | 56 | You may need to change documents dimensions to cm to run it properly. I believe this was fixed, but until I have confirmation the warning will stay here. 57 | 58 | 59 | ### TODO list: 60 | 61 | - addin functionality is not being used properly. It currently cannot be loaded at startup and is working like a script (needs to be fixed before we make a release version) 62 | - add button to launch command from toolbar 63 | - add masses and moments of inertia to model (currently i only read them and write them down to debug) 64 | - add prismatic joints 65 | - add control to change joint types 66 | - add control to change link origins (solidworks plugin allows this, but is it even necessary?) 67 | 68 | ### Planned features list 69 | 70 | - generate also srdf 71 | - update joint visibility when command starts 72 | - add a control to change the colour of the link and maybe add a texture (rviz supports this, so no reason why I shouldn't either) 73 | - add mimic joints 74 | - add the ability to save progress halfway: currently I don't know how to do this. Pickle does not save swig objects, and I do have the .groups property in links (and maybe something in joints as well), so I can't really save it completely. Perhaps I should clear this property and have a method to set it by name. 75 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(mypackage) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED) 11 | 12 | ## System dependencies are found with CMake's conventions 13 | # find_package(Boost REQUIRED COMPONENTS system) 14 | 15 | 16 | ## Uncomment this if the package has a setup.py. This macro ensures 17 | ## modules and global scripts declared therein get installed 18 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 19 | # catkin_python_setup() 20 | 21 | ################################################ 22 | ## Declare ROS messages, services and actions ## 23 | ################################################ 24 | 25 | ## To declare and build messages, services or actions from within this 26 | ## package, follow these steps: 27 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 28 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 29 | ## * In the file package.xml: 30 | ## * add a build_depend tag for "message_generation" 31 | ## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET 32 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 33 | ## but can be declared for certainty nonetheless: 34 | ## * add a exec_depend tag for "message_runtime" 35 | ## * In this file (CMakeLists.txt): 36 | ## * add "message_generation" and every package in MSG_DEP_SET to 37 | ## find_package(catkin REQUIRED COMPONENTS ...) 38 | ## * add "message_runtime" and every package in MSG_DEP_SET to 39 | ## catkin_package(CATKIN_DEPENDS ...) 40 | ## * uncomment the add_*_files sections below as needed 41 | ## and list every .msg/.srv/.action file to be processed 42 | ## * uncomment the generate_messages entry below 43 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 44 | 45 | ## Generate messages in the 'msg' folder 46 | # add_message_files( 47 | # FILES 48 | # Message1.msg 49 | # Message2.msg 50 | # ) 51 | 52 | ## Generate services in the 'srv' folder 53 | # add_service_files( 54 | # FILES 55 | # Service1.srv 56 | # Service2.srv 57 | # ) 58 | 59 | ## Generate actions in the 'action' folder 60 | # add_action_files( 61 | # FILES 62 | # Action1.action 63 | # Action2.action 64 | # ) 65 | 66 | ## Generate added messages and services with any dependencies listed here 67 | # generate_messages( 68 | # DEPENDENCIES 69 | # std_msgs # Or other packages containing msgs 70 | # ) 71 | 72 | ################################################ 73 | ## Declare ROS dynamic reconfigure parameters ## 74 | ################################################ 75 | 76 | ## To declare and build dynamic reconfigure parameters within this 77 | ## package, follow these steps: 78 | ## * In the file package.xml: 79 | ## * add a build_depend and a exec_depend tag for "dynamic_reconfigure" 80 | ## * In this file (CMakeLists.txt): 81 | ## * add "dynamic_reconfigure" to 82 | ## find_package(catkin REQUIRED COMPONENTS ...) 83 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 84 | ## and list every .cfg file to be processed 85 | 86 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 87 | # generate_dynamic_reconfigure_options( 88 | # cfg/DynReconf1.cfg 89 | # cfg/DynReconf2.cfg 90 | # ) 91 | 92 | ################################### 93 | ## catkin specific configuration ## 94 | ################################### 95 | ## The catkin_package macro generates cmake config files for your package 96 | ## Declare things to be passed to dependent projects 97 | ## INCLUDE_DIRS: uncomment this if your package contains header files 98 | ## LIBRARIES: libraries you create in this project that dependent projects also need 99 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 100 | ## DEPENDS: system dependencies of this project that dependent projects also need 101 | catkin_package( 102 | # INCLUDE_DIRS include 103 | # LIBRARIES mypackage 104 | # CATKIN_DEPENDS other_catkin_pkg 105 | # DEPENDS system_lib 106 | ) 107 | 108 | ########### 109 | ## Build ## 110 | ########### 111 | 112 | ## Specify additional locations of header files 113 | ## Your package locations should be listed before other locations 114 | include_directories( 115 | # include 116 | # ${catkin_INCLUDE_DIRS} 117 | ) 118 | 119 | ## Declare a C++ library 120 | # add_library(${PROJECT_NAME} 121 | # src/${PROJECT_NAME}/mypackage.cpp 122 | # ) 123 | 124 | ## Add cmake target dependencies of the library 125 | ## as an example, code may need to be generated before libraries 126 | ## either from message generation or dynamic reconfigure 127 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 128 | 129 | ## Declare a C++ executable 130 | ## With catkin_make all packages are built within a single CMake context 131 | ## The recommended prefix ensures that target names across packages don't collide 132 | # add_executable(${PROJECT_NAME}_node src/mypackage_node.cpp) 133 | 134 | ## Rename C++ executable without prefix 135 | ## The above recommended prefix causes long target names, the following renames the 136 | ## target back to the shorter version for ease of user use 137 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 138 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 139 | 140 | ## Add cmake target dependencies of the executable 141 | ## same as for the library above 142 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 143 | 144 | ## Specify libraries to link a library or executable target against 145 | # target_link_libraries(${PROJECT_NAME}_node 146 | # ${catkin_LIBRARIES} 147 | # ) 148 | 149 | ############# 150 | ## Install ## 151 | ############# 152 | 153 | # all install targets should use catkin DESTINATION variables 154 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 155 | 156 | ## Mark executable scripts (Python etc.) for installation 157 | ## in contrast to setup.py, you can choose the destination 158 | # install(PROGRAMS 159 | # scripts/my_python_script 160 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 161 | # ) 162 | 163 | ## Mark executables and/or libraries for installation 164 | # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node 165 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 166 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 167 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 168 | # ) 169 | 170 | ## Mark cpp header files for installation 171 | # install(DIRECTORY include/${PROJECT_NAME}/ 172 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 173 | # FILES_MATCHING PATTERN "*.h" 174 | # PATTERN ".svn" EXCLUDE 175 | # ) 176 | 177 | ## Mark other files for installation (e.g. launch and bag files, etc.) 178 | # install(FILES 179 | # # myfile1 180 | # # myfile2 181 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 182 | # ) 183 | 184 | ############# 185 | ## Testing ## 186 | ############# 187 | 188 | ## Add gtest based cpp test target and link libraries 189 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_mypackage.cpp) 190 | # if(TARGET ${PROJECT_NAME}-test) 191 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 192 | # endif() 193 | 194 | ## Add folders to be run by python nosetests 195 | # catkin_add_nosetests(test) -------------------------------------------------------------------------------- /urdf_generator/mypackage/components/link10.stp: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | /* Generated by software containing ST-Developer 4 | * from STEP Tools, Inc. (www.steptools.com) 5 | */ 6 | 7 | FILE_DESCRIPTION( 8 | /* description */ (''), 9 | /* implementation_level */ '2;1'); 10 | 11 | FILE_NAME( 12 | /* name */ 13 | 'C:/Users/Frederico/OneDrive/Dokumenty/mypackage/components//link10.st 14 | p', 15 | /* time_stamp */ '2018-08-21T11:21:30+01:00', 16 | /* author */ (''), 17 | /* organization */ (''), 18 | /* preprocessor_version */ 'ST-DEVELOPER v17', 19 | /* originating_system */ 'Autodesk Translation Framework v7.1.0.215', 20 | /* authorisation */ ''); 21 | 22 | FILE_SCHEMA (('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 23 | ENDSEC; 24 | 25 | DATA; 26 | #10=MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#13),#86); 27 | #11=SHAPE_REPRESENTATION_RELATIONSHIP('SRR','None',#93,#12); 28 | #12=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#14),#85); 29 | #13=STYLED_ITEM('',(#102),#14); 30 | #14=MANIFOLD_SOLID_BREP('Body1',#42); 31 | #15=PLANE('',#59); 32 | #16=PLANE('',#60); 33 | #17=FACE_OUTER_BOUND('',#20,.T.); 34 | #18=FACE_OUTER_BOUND('',#21,.T.); 35 | #19=FACE_OUTER_BOUND('',#22,.T.); 36 | #20=EDGE_LOOP('',(#32,#33,#34,#35)); 37 | #21=EDGE_LOOP('',(#36)); 38 | #22=EDGE_LOOP('',(#37)); 39 | #23=LINE('',#79,#24); 40 | #24=VECTOR('',#67,58.); 41 | #25=CIRCLE('',#57,58.); 42 | #26=CIRCLE('',#58,58.); 43 | #27=VERTEX_POINT('',#76); 44 | #28=VERTEX_POINT('',#78); 45 | #29=EDGE_CURVE('',#27,#27,#25,.T.); 46 | #30=EDGE_CURVE('',#27,#28,#23,.T.); 47 | #31=EDGE_CURVE('',#28,#28,#26,.T.); 48 | #32=ORIENTED_EDGE('',*,*,#29,.F.); 49 | #33=ORIENTED_EDGE('',*,*,#30,.T.); 50 | #34=ORIENTED_EDGE('',*,*,#31,.T.); 51 | #35=ORIENTED_EDGE('',*,*,#30,.F.); 52 | #36=ORIENTED_EDGE('',*,*,#29,.T.); 53 | #37=ORIENTED_EDGE('',*,*,#31,.F.); 54 | #38=CYLINDRICAL_SURFACE('',#56,58.); 55 | #39=ADVANCED_FACE('',(#17),#38,.T.); 56 | #40=ADVANCED_FACE('',(#18),#15,.T.); 57 | #41=ADVANCED_FACE('',(#19),#16,.F.); 58 | #42=CLOSED_SHELL('',(#39,#40,#41)); 59 | #43=DERIVED_UNIT_ELEMENT(#45,1.); 60 | #44=DERIVED_UNIT_ELEMENT(#88,3.); 61 | #45=( 62 | MASS_UNIT() 63 | NAMED_UNIT(*) 64 | SI_UNIT(.KILO.,.GRAM.) 65 | ); 66 | #46=DERIVED_UNIT((#43,#44)); 67 | #47=MEASURE_REPRESENTATION_ITEM('density measure', 68 | POSITIVE_RATIO_MEASURE(7850.),#46); 69 | #48=PROPERTY_DEFINITION_REPRESENTATION(#53,#50); 70 | #49=PROPERTY_DEFINITION_REPRESENTATION(#54,#51); 71 | #50=REPRESENTATION('material name',(#52),#85); 72 | #51=REPRESENTATION('density',(#47),#85); 73 | #52=DESCRIPTIVE_REPRESENTATION_ITEM('Steel','Steel'); 74 | #53=PROPERTY_DEFINITION('material property','material name',#95); 75 | #54=PROPERTY_DEFINITION('material property','density of part',#95); 76 | #55=AXIS2_PLACEMENT_3D('placement',#74,#61,#62); 77 | #56=AXIS2_PLACEMENT_3D('',#75,#63,#64); 78 | #57=AXIS2_PLACEMENT_3D('',#77,#65,#66); 79 | #58=AXIS2_PLACEMENT_3D('',#80,#68,#69); 80 | #59=AXIS2_PLACEMENT_3D('',#81,#70,#71); 81 | #60=AXIS2_PLACEMENT_3D('',#82,#72,#73); 82 | #61=DIRECTION('axis',(0.,0.,1.)); 83 | #62=DIRECTION('refdir',(1.,0.,0.)); 84 | #63=DIRECTION('center_axis',(0.,1.,0.)); 85 | #64=DIRECTION('ref_axis',(1.,0.,0.)); 86 | #65=DIRECTION('center_axis',(0.,1.,0.)); 87 | #66=DIRECTION('ref_axis',(1.,0.,0.)); 88 | #67=DIRECTION('',(0.,-1.,0.)); 89 | #68=DIRECTION('center_axis',(0.,1.,0.)); 90 | #69=DIRECTION('ref_axis',(1.,0.,0.)); 91 | #70=DIRECTION('center_axis',(0.,1.,0.)); 92 | #71=DIRECTION('ref_axis',(1.,0.,0.)); 93 | #72=DIRECTION('center_axis',(0.,1.,0.)); 94 | #73=DIRECTION('ref_axis',(1.,0.,0.)); 95 | #74=CARTESIAN_POINT('',(0.,0.,0.)); 96 | #75=CARTESIAN_POINT('Origin',(169.325883186367,0.,10.521812857454)); 97 | #76=CARTESIAN_POINT('',(111.325883186367,128.,10.521812857454)); 98 | #77=CARTESIAN_POINT('Origin',(169.325883186367,128.,10.521812857454)); 99 | #78=CARTESIAN_POINT('',(111.325883186367,0.,10.521812857454)); 100 | #79=CARTESIAN_POINT('',(111.325883186367,0.,10.521812857454)); 101 | #80=CARTESIAN_POINT('Origin',(169.325883186367,0.,10.521812857454)); 102 | #81=CARTESIAN_POINT('Origin',(169.325883186367,128.,10.521812857454)); 103 | #82=CARTESIAN_POINT('Origin',(169.325883186367,0.,10.521812857454)); 104 | #83=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 105 | 'DISTANCE_ACCURACY_VALUE', 106 | 'Maximum model space distance between geometric entities at asserted c 107 | onnectivities'); 108 | #84=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 109 | 'DISTANCE_ACCURACY_VALUE', 110 | 'Maximum model space distance between geometric entities at asserted c 111 | onnectivities'); 112 | #85=( 113 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 114 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#83)) 115 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 116 | REPRESENTATION_CONTEXT('','3D') 117 | ); 118 | #86=( 119 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 120 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#84)) 121 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 122 | REPRESENTATION_CONTEXT('','3D') 123 | ); 124 | #87=( 125 | LENGTH_UNIT() 126 | NAMED_UNIT(*) 127 | SI_UNIT(.MILLI.,.METRE.) 128 | ); 129 | #88=( 130 | LENGTH_UNIT() 131 | NAMED_UNIT(*) 132 | SI_UNIT($,.METRE.) 133 | ); 134 | #89=( 135 | NAMED_UNIT(*) 136 | SI_UNIT($,.STERADIAN.) 137 | SOLID_ANGLE_UNIT() 138 | ); 139 | #90=( 140 | NAMED_UNIT(*) 141 | PLANE_ANGLE_UNIT() 142 | SI_UNIT($,.RADIAN.) 143 | ); 144 | #91=SHAPE_DEFINITION_REPRESENTATION(#92,#93); 145 | #92=PRODUCT_DEFINITION_SHAPE('',$,#95); 146 | #93=SHAPE_REPRESENTATION('',(#55),#85); 147 | #94=PRODUCT_DEFINITION_CONTEXT('part definition',#99,'design'); 148 | #95=PRODUCT_DEFINITION('ShoulderYawTop','ShoulderYawTop',#96,#94); 149 | #96=PRODUCT_DEFINITION_FORMATION('',$,#101); 150 | #97=PRODUCT_RELATED_PRODUCT_CATEGORY('ShoulderYawTop','ShoulderYawTop', 151 | (#101)); 152 | #98=APPLICATION_PROTOCOL_DEFINITION('international standard', 153 | 'automotive_design',2009,#99); 154 | #99=APPLICATION_CONTEXT( 155 | 'Core Data for Automotive Mechanical Design Process'); 156 | #100=PRODUCT_CONTEXT('part definition',#99,'mechanical'); 157 | #101=PRODUCT('ShoulderYawTop','ShoulderYawTop',$,(#100)); 158 | #102=PRESENTATION_STYLE_ASSIGNMENT((#103)); 159 | #103=SURFACE_STYLE_USAGE(.BOTH.,#104); 160 | #104=SURFACE_SIDE_STYLE('',(#105)); 161 | #105=SURFACE_STYLE_FILL_AREA(#106); 162 | #106=FILL_AREA_STYLE('Steel - Satin',(#107)); 163 | #107=FILL_AREA_STYLE_COLOUR('Steel - Satin',#108); 164 | #108=COLOUR_RGB('Steel - Satin',0.627450980392157,0.627450980392157,0.627450980392157); 165 | ENDSEC; 166 | END-ISO-10303-21; 167 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/components/link11.stp: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | /* Generated by software containing ST-Developer 4 | * from STEP Tools, Inc. (www.steptools.com) 5 | */ 6 | 7 | FILE_DESCRIPTION( 8 | /* description */ (''), 9 | /* implementation_level */ '2;1'); 10 | 11 | FILE_NAME( 12 | /* name */ 13 | 'C:/Users/Frederico/OneDrive/Dokumenty/mypackage/components//link11.st 14 | p', 15 | /* time_stamp */ '2018-08-21T11:21:30+01:00', 16 | /* author */ (''), 17 | /* organization */ (''), 18 | /* preprocessor_version */ 'ST-DEVELOPER v17', 19 | /* originating_system */ 'Autodesk Translation Framework v7.1.0.215', 20 | /* authorisation */ ''); 21 | 22 | FILE_SCHEMA (('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 23 | ENDSEC; 24 | 25 | DATA; 26 | #10=MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#13),#86); 27 | #11=SHAPE_REPRESENTATION_RELATIONSHIP('SRR','None',#93,#12); 28 | #12=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#14),#85); 29 | #13=STYLED_ITEM('',(#102),#14); 30 | #14=MANIFOLD_SOLID_BREP('Body1',#42); 31 | #15=PLANE('',#59); 32 | #16=PLANE('',#60); 33 | #17=FACE_OUTER_BOUND('',#20,.T.); 34 | #18=FACE_OUTER_BOUND('',#21,.T.); 35 | #19=FACE_OUTER_BOUND('',#22,.T.); 36 | #20=EDGE_LOOP('',(#32,#33,#34,#35)); 37 | #21=EDGE_LOOP('',(#36)); 38 | #22=EDGE_LOOP('',(#37)); 39 | #23=LINE('',#79,#24); 40 | #24=VECTOR('',#67,58.); 41 | #25=CIRCLE('',#57,58.); 42 | #26=CIRCLE('',#58,58.); 43 | #27=VERTEX_POINT('',#76); 44 | #28=VERTEX_POINT('',#78); 45 | #29=EDGE_CURVE('',#27,#27,#25,.T.); 46 | #30=EDGE_CURVE('',#27,#28,#23,.T.); 47 | #31=EDGE_CURVE('',#28,#28,#26,.T.); 48 | #32=ORIENTED_EDGE('',*,*,#29,.F.); 49 | #33=ORIENTED_EDGE('',*,*,#30,.T.); 50 | #34=ORIENTED_EDGE('',*,*,#31,.T.); 51 | #35=ORIENTED_EDGE('',*,*,#30,.F.); 52 | #36=ORIENTED_EDGE('',*,*,#29,.T.); 53 | #37=ORIENTED_EDGE('',*,*,#31,.F.); 54 | #38=CYLINDRICAL_SURFACE('',#56,58.); 55 | #39=ADVANCED_FACE('',(#17),#38,.T.); 56 | #40=ADVANCED_FACE('',(#18),#15,.T.); 57 | #41=ADVANCED_FACE('',(#19),#16,.F.); 58 | #42=CLOSED_SHELL('',(#39,#40,#41)); 59 | #43=DERIVED_UNIT_ELEMENT(#45,1.); 60 | #44=DERIVED_UNIT_ELEMENT(#88,3.); 61 | #45=( 62 | MASS_UNIT() 63 | NAMED_UNIT(*) 64 | SI_UNIT(.KILO.,.GRAM.) 65 | ); 66 | #46=DERIVED_UNIT((#43,#44)); 67 | #47=MEASURE_REPRESENTATION_ITEM('density measure', 68 | POSITIVE_RATIO_MEASURE(7850.),#46); 69 | #48=PROPERTY_DEFINITION_REPRESENTATION(#53,#50); 70 | #49=PROPERTY_DEFINITION_REPRESENTATION(#54,#51); 71 | #50=REPRESENTATION('material name',(#52),#85); 72 | #51=REPRESENTATION('density',(#47),#85); 73 | #52=DESCRIPTIVE_REPRESENTATION_ITEM('Steel','Steel'); 74 | #53=PROPERTY_DEFINITION('material property','material name',#95); 75 | #54=PROPERTY_DEFINITION('material property','density of part',#95); 76 | #55=AXIS2_PLACEMENT_3D('placement',#74,#61,#62); 77 | #56=AXIS2_PLACEMENT_3D('',#75,#63,#64); 78 | #57=AXIS2_PLACEMENT_3D('',#77,#65,#66); 79 | #58=AXIS2_PLACEMENT_3D('',#80,#68,#69); 80 | #59=AXIS2_PLACEMENT_3D('',#81,#70,#71); 81 | #60=AXIS2_PLACEMENT_3D('',#82,#72,#73); 82 | #61=DIRECTION('axis',(0.,0.,1.)); 83 | #62=DIRECTION('refdir',(1.,0.,0.)); 84 | #63=DIRECTION('center_axis',(0.,1.,0.)); 85 | #64=DIRECTION('ref_axis',(1.,0.,0.)); 86 | #65=DIRECTION('center_axis',(0.,1.,0.)); 87 | #66=DIRECTION('ref_axis',(1.,0.,0.)); 88 | #67=DIRECTION('',(0.,-1.,0.)); 89 | #68=DIRECTION('center_axis',(0.,1.,0.)); 90 | #69=DIRECTION('ref_axis',(1.,0.,0.)); 91 | #70=DIRECTION('center_axis',(0.,1.,0.)); 92 | #71=DIRECTION('ref_axis',(1.,0.,0.)); 93 | #72=DIRECTION('center_axis',(0.,1.,0.)); 94 | #73=DIRECTION('ref_axis',(1.,0.,0.)); 95 | #74=CARTESIAN_POINT('',(0.,0.,0.)); 96 | #75=CARTESIAN_POINT('Origin',(0.,0.,0.)); 97 | #76=CARTESIAN_POINT('',(-58.,63.,7.10295143505465E-15)); 98 | #77=CARTESIAN_POINT('Origin',(0.,63.,0.)); 99 | #78=CARTESIAN_POINT('',(-58.,0.,7.10295143505465E-15)); 100 | #79=CARTESIAN_POINT('',(-58.,0.,7.10295143505465E-15)); 101 | #80=CARTESIAN_POINT('Origin',(0.,0.,0.)); 102 | #81=CARTESIAN_POINT('Origin',(0.,63.,0.)); 103 | #82=CARTESIAN_POINT('Origin',(0.,0.,0.)); 104 | #83=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 105 | 'DISTANCE_ACCURACY_VALUE', 106 | 'Maximum model space distance between geometric entities at asserted c 107 | onnectivities'); 108 | #84=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 109 | 'DISTANCE_ACCURACY_VALUE', 110 | 'Maximum model space distance between geometric entities at asserted c 111 | onnectivities'); 112 | #85=( 113 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 114 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#83)) 115 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 116 | REPRESENTATION_CONTEXT('','3D') 117 | ); 118 | #86=( 119 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 120 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#84)) 121 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 122 | REPRESENTATION_CONTEXT('','3D') 123 | ); 124 | #87=( 125 | LENGTH_UNIT() 126 | NAMED_UNIT(*) 127 | SI_UNIT(.MILLI.,.METRE.) 128 | ); 129 | #88=( 130 | LENGTH_UNIT() 131 | NAMED_UNIT(*) 132 | SI_UNIT($,.METRE.) 133 | ); 134 | #89=( 135 | NAMED_UNIT(*) 136 | SI_UNIT($,.STERADIAN.) 137 | SOLID_ANGLE_UNIT() 138 | ); 139 | #90=( 140 | NAMED_UNIT(*) 141 | PLANE_ANGLE_UNIT() 142 | SI_UNIT($,.RADIAN.) 143 | ); 144 | #91=SHAPE_DEFINITION_REPRESENTATION(#92,#93); 145 | #92=PRODUCT_DEFINITION_SHAPE('',$,#95); 146 | #93=SHAPE_REPRESENTATION('',(#55),#85); 147 | #94=PRODUCT_DEFINITION_CONTEXT('part definition',#99,'design'); 148 | #95=PRODUCT_DEFINITION('ShoulderYawBottom','ShoulderYawBottom',#96,#94); 149 | #96=PRODUCT_DEFINITION_FORMATION('',$,#101); 150 | #97=PRODUCT_RELATED_PRODUCT_CATEGORY('ShoulderYawBottom', 151 | 'ShoulderYawBottom',(#101)); 152 | #98=APPLICATION_PROTOCOL_DEFINITION('international standard', 153 | 'automotive_design',2009,#99); 154 | #99=APPLICATION_CONTEXT( 155 | 'Core Data for Automotive Mechanical Design Process'); 156 | #100=PRODUCT_CONTEXT('part definition',#99,'mechanical'); 157 | #101=PRODUCT('ShoulderYawBottom','ShoulderYawBottom',$,(#100)); 158 | #102=PRESENTATION_STYLE_ASSIGNMENT((#103)); 159 | #103=SURFACE_STYLE_USAGE(.BOTH.,#104); 160 | #104=SURFACE_SIDE_STYLE('',(#105)); 161 | #105=SURFACE_STYLE_FILL_AREA(#106); 162 | #106=FILL_AREA_STYLE('Steel - Satin',(#107)); 163 | #107=FILL_AREA_STYLE_COLOUR('Steel - Satin',#108); 164 | #108=COLOUR_RGB('Steel - Satin',0.627450980392157,0.627450980392157,0.627450980392157); 165 | ENDSEC; 166 | END-ISO-10303-21; 167 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/components/link20.stp: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | /* Generated by software containing ST-Developer 4 | * from STEP Tools, Inc. (www.steptools.com) 5 | */ 6 | 7 | FILE_DESCRIPTION( 8 | /* description */ (''), 9 | /* implementation_level */ '2;1'); 10 | 11 | FILE_NAME( 12 | /* name */ 13 | 'C:/Users/Frederico/OneDrive/Dokumenty/mypackage/components//link20.st 14 | p', 15 | /* time_stamp */ '2018-08-21T11:21:30+01:00', 16 | /* author */ (''), 17 | /* organization */ (''), 18 | /* preprocessor_version */ 'ST-DEVELOPER v17', 19 | /* originating_system */ 'Autodesk Translation Framework v7.1.0.215', 20 | /* authorisation */ ''); 21 | 22 | FILE_SCHEMA (('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 23 | ENDSEC; 24 | 25 | DATA; 26 | #10=MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#13),#86); 27 | #11=SHAPE_REPRESENTATION_RELATIONSHIP('SRR','None',#93,#12); 28 | #12=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#14),#85); 29 | #13=STYLED_ITEM('',(#102),#14); 30 | #14=MANIFOLD_SOLID_BREP('Body1',#42); 31 | #15=PLANE('',#59); 32 | #16=PLANE('',#60); 33 | #17=FACE_OUTER_BOUND('',#20,.T.); 34 | #18=FACE_OUTER_BOUND('',#21,.T.); 35 | #19=FACE_OUTER_BOUND('',#22,.T.); 36 | #20=EDGE_LOOP('',(#32,#33,#34,#35)); 37 | #21=EDGE_LOOP('',(#36)); 38 | #22=EDGE_LOOP('',(#37)); 39 | #23=LINE('',#79,#24); 40 | #24=VECTOR('',#67,58.); 41 | #25=CIRCLE('',#57,58.); 42 | #26=CIRCLE('',#58,58.); 43 | #27=VERTEX_POINT('',#76); 44 | #28=VERTEX_POINT('',#78); 45 | #29=EDGE_CURVE('',#27,#27,#25,.T.); 46 | #30=EDGE_CURVE('',#27,#28,#23,.T.); 47 | #31=EDGE_CURVE('',#28,#28,#26,.T.); 48 | #32=ORIENTED_EDGE('',*,*,#29,.F.); 49 | #33=ORIENTED_EDGE('',*,*,#30,.T.); 50 | #34=ORIENTED_EDGE('',*,*,#31,.T.); 51 | #35=ORIENTED_EDGE('',*,*,#30,.F.); 52 | #36=ORIENTED_EDGE('',*,*,#29,.T.); 53 | #37=ORIENTED_EDGE('',*,*,#31,.F.); 54 | #38=CYLINDRICAL_SURFACE('',#56,58.); 55 | #39=ADVANCED_FACE('',(#17),#38,.T.); 56 | #40=ADVANCED_FACE('',(#18),#15,.T.); 57 | #41=ADVANCED_FACE('',(#19),#16,.F.); 58 | #42=CLOSED_SHELL('',(#39,#40,#41)); 59 | #43=DERIVED_UNIT_ELEMENT(#45,1.); 60 | #44=DERIVED_UNIT_ELEMENT(#88,3.); 61 | #45=( 62 | MASS_UNIT() 63 | NAMED_UNIT(*) 64 | SI_UNIT(.KILO.,.GRAM.) 65 | ); 66 | #46=DERIVED_UNIT((#43,#44)); 67 | #47=MEASURE_REPRESENTATION_ITEM('density measure', 68 | POSITIVE_RATIO_MEASURE(7850.),#46); 69 | #48=PROPERTY_DEFINITION_REPRESENTATION(#53,#50); 70 | #49=PROPERTY_DEFINITION_REPRESENTATION(#54,#51); 71 | #50=REPRESENTATION('material name',(#52),#85); 72 | #51=REPRESENTATION('density',(#47),#85); 73 | #52=DESCRIPTIVE_REPRESENTATION_ITEM('Steel','Steel'); 74 | #53=PROPERTY_DEFINITION('material property','material name',#95); 75 | #54=PROPERTY_DEFINITION('material property','density of part',#95); 76 | #55=AXIS2_PLACEMENT_3D('placement',#74,#61,#62); 77 | #56=AXIS2_PLACEMENT_3D('',#75,#63,#64); 78 | #57=AXIS2_PLACEMENT_3D('',#77,#65,#66); 79 | #58=AXIS2_PLACEMENT_3D('',#80,#68,#69); 80 | #59=AXIS2_PLACEMENT_3D('',#81,#70,#71); 81 | #60=AXIS2_PLACEMENT_3D('',#82,#72,#73); 82 | #61=DIRECTION('axis',(0.,0.,1.)); 83 | #62=DIRECTION('refdir',(1.,0.,0.)); 84 | #63=DIRECTION('center_axis',(0.,1.,0.)); 85 | #64=DIRECTION('ref_axis',(1.,0.,0.)); 86 | #65=DIRECTION('center_axis',(0.,1.,0.)); 87 | #66=DIRECTION('ref_axis',(1.,0.,0.)); 88 | #67=DIRECTION('',(0.,-1.,0.)); 89 | #68=DIRECTION('center_axis',(0.,1.,0.)); 90 | #69=DIRECTION('ref_axis',(1.,0.,0.)); 91 | #70=DIRECTION('center_axis',(0.,1.,0.)); 92 | #71=DIRECTION('ref_axis',(1.,0.,0.)); 93 | #72=DIRECTION('center_axis',(0.,1.,0.)); 94 | #73=DIRECTION('ref_axis',(1.,0.,0.)); 95 | #74=CARTESIAN_POINT('',(0.,0.,0.)); 96 | #75=CARTESIAN_POINT('Origin',(314.422234093385,0.,-15.2664935590904)); 97 | #76=CARTESIAN_POINT('',(256.422234093385,134.,-15.2664935590904)); 98 | #77=CARTESIAN_POINT('Origin',(314.422234093385,134.,-15.2664935590904)); 99 | #78=CARTESIAN_POINT('',(256.422234093385,0.,-15.2664935590904)); 100 | #79=CARTESIAN_POINT('',(256.422234093385,0.,-15.2664935590904)); 101 | #80=CARTESIAN_POINT('Origin',(314.422234093385,0.,-15.2664935590904)); 102 | #81=CARTESIAN_POINT('Origin',(314.422234093385,134.,-15.2664935590904)); 103 | #82=CARTESIAN_POINT('Origin',(314.422234093385,0.,-15.2664935590904)); 104 | #83=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 105 | 'DISTANCE_ACCURACY_VALUE', 106 | 'Maximum model space distance between geometric entities at asserted c 107 | onnectivities'); 108 | #84=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 109 | 'DISTANCE_ACCURACY_VALUE', 110 | 'Maximum model space distance between geometric entities at asserted c 111 | onnectivities'); 112 | #85=( 113 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 114 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#83)) 115 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 116 | REPRESENTATION_CONTEXT('','3D') 117 | ); 118 | #86=( 119 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 120 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#84)) 121 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 122 | REPRESENTATION_CONTEXT('','3D') 123 | ); 124 | #87=( 125 | LENGTH_UNIT() 126 | NAMED_UNIT(*) 127 | SI_UNIT(.MILLI.,.METRE.) 128 | ); 129 | #88=( 130 | LENGTH_UNIT() 131 | NAMED_UNIT(*) 132 | SI_UNIT($,.METRE.) 133 | ); 134 | #89=( 135 | NAMED_UNIT(*) 136 | SI_UNIT($,.STERADIAN.) 137 | SOLID_ANGLE_UNIT() 138 | ); 139 | #90=( 140 | NAMED_UNIT(*) 141 | PLANE_ANGLE_UNIT() 142 | SI_UNIT($,.RADIAN.) 143 | ); 144 | #91=SHAPE_DEFINITION_REPRESENTATION(#92,#93); 145 | #92=PRODUCT_DEFINITION_SHAPE('',$,#95); 146 | #93=SHAPE_REPRESENTATION('',(#55),#85); 147 | #94=PRODUCT_DEFINITION_CONTEXT('part definition',#99,'design'); 148 | #95=PRODUCT_DEFINITION('ShoulderRoll','ShoulderRoll',#96,#94); 149 | #96=PRODUCT_DEFINITION_FORMATION('',$,#101); 150 | #97=PRODUCT_RELATED_PRODUCT_CATEGORY('ShoulderRoll','ShoulderRoll',(#101)); 151 | #98=APPLICATION_PROTOCOL_DEFINITION('international standard', 152 | 'automotive_design',2009,#99); 153 | #99=APPLICATION_CONTEXT( 154 | 'Core Data for Automotive Mechanical Design Process'); 155 | #100=PRODUCT_CONTEXT('part definition',#99,'mechanical'); 156 | #101=PRODUCT('ShoulderRoll','ShoulderRoll',$,(#100)); 157 | #102=PRESENTATION_STYLE_ASSIGNMENT((#103)); 158 | #103=SURFACE_STYLE_USAGE(.BOTH.,#104); 159 | #104=SURFACE_SIDE_STYLE('',(#105)); 160 | #105=SURFACE_STYLE_FILL_AREA(#106); 161 | #106=FILL_AREA_STYLE('Steel - Satin',(#107)); 162 | #107=FILL_AREA_STYLE_COLOUR('Steel - Satin',#108); 163 | #108=COLOUR_RGB('Steel - Satin',0.627450980392157,0.627450980392157,0.627450980392157); 164 | ENDSEC; 165 | END-ISO-10303-21; 166 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/components/link30.stp: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | /* Generated by software containing ST-Developer 4 | * from STEP Tools, Inc. (www.steptools.com) 5 | */ 6 | 7 | FILE_DESCRIPTION( 8 | /* description */ (''), 9 | /* implementation_level */ '2;1'); 10 | 11 | FILE_NAME( 12 | /* name */ 13 | 'C:/Users/Frederico/OneDrive/Dokumenty/mypackage/components//link30.st 14 | p', 15 | /* time_stamp */ '2018-08-21T11:21:31+01:00', 16 | /* author */ (''), 17 | /* organization */ (''), 18 | /* preprocessor_version */ 'ST-DEVELOPER v17', 19 | /* originating_system */ 'Autodesk Translation Framework v7.1.0.215', 20 | /* authorisation */ ''); 21 | 22 | FILE_SCHEMA (('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 23 | ENDSEC; 24 | 25 | DATA; 26 | #10=MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#13),#187); 27 | #11=SHAPE_REPRESENTATION_RELATIONSHIP('SRR','None',#194,#12); 28 | #12=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#14),#186); 29 | #13=STYLED_ITEM('',(#203),#14); 30 | #14=MANIFOLD_SOLID_BREP('Body1',#95); 31 | #15=FACE_BOUND('',#32,.T.); 32 | #16=PLANE('',#118); 33 | #17=PLANE('',#122); 34 | #18=PLANE('',#123); 35 | #19=CIRCLE('',#117,30.); 36 | #20=CIRCLE('',#120,30.); 37 | #21=CIRCLE('',#121,30.); 38 | #22=FACE_OUTER_BOUND('',#28,.T.); 39 | #23=FACE_OUTER_BOUND('',#29,.T.); 40 | #24=FACE_OUTER_BOUND('',#30,.T.); 41 | #25=FACE_OUTER_BOUND('',#31,.T.); 42 | #26=FACE_OUTER_BOUND('',#33,.T.); 43 | #27=FACE_OUTER_BOUND('',#34,.T.); 44 | #28=EDGE_LOOP('',(#64,#65,#66,#67,#68,#69,#70,#71)); 45 | #29=EDGE_LOOP('',(#72,#73,#74,#75)); 46 | #30=EDGE_LOOP('',(#76)); 47 | #31=EDGE_LOOP('',(#77,#78,#79,#80)); 48 | #32=EDGE_LOOP('',(#81,#82,#83)); 49 | #33=EDGE_LOOP('',(#84)); 50 | #34=EDGE_LOOP('',(#85)); 51 | #35=LINE('',#166,#37); 52 | #36=LINE('',#180,#38); 53 | #37=VECTOR('',#132,30.); 54 | #38=VECTOR('',#151,30.); 55 | #39=ELLIPSE('',#110,42.4264068711929,30.); 56 | #40=ELLIPSE('',#111,42.4264068711928,30.); 57 | #41=ELLIPSE('',#112,42.4264068711929,30.); 58 | #42=ELLIPSE('',#113,42.4264068711929,30.); 59 | #43=ELLIPSE('',#114,42.4264068711929,30.); 60 | #44=ELLIPSE('',#115,42.4264068711928,30.); 61 | #45=VERTEX_POINT('',#160); 62 | #46=VERTEX_POINT('',#161); 63 | #47=VERTEX_POINT('',#163); 64 | #48=VERTEX_POINT('',#165); 65 | #49=VERTEX_POINT('',#167); 66 | #50=VERTEX_POINT('',#169); 67 | #51=VERTEX_POINT('',#177); 68 | #52=VERTEX_POINT('',#179); 69 | #53=EDGE_CURVE('',#45,#46,#39,.T.); 70 | #54=EDGE_CURVE('',#47,#45,#40,.T.); 71 | #55=EDGE_CURVE('',#47,#48,#35,.T.); 72 | #56=EDGE_CURVE('',#49,#48,#41,.T.); 73 | #57=EDGE_CURVE('',#50,#49,#42,.T.); 74 | #58=EDGE_CURVE('',#48,#50,#43,.T.); 75 | #59=EDGE_CURVE('',#46,#47,#44,.T.); 76 | #60=EDGE_CURVE('',#48,#48,#19,.T.); 77 | #61=EDGE_CURVE('',#51,#51,#20,.T.); 78 | #62=EDGE_CURVE('',#51,#52,#36,.T.); 79 | #63=EDGE_CURVE('',#52,#52,#21,.T.); 80 | #64=ORIENTED_EDGE('',*,*,#53,.F.); 81 | #65=ORIENTED_EDGE('',*,*,#54,.F.); 82 | #66=ORIENTED_EDGE('',*,*,#55,.T.); 83 | #67=ORIENTED_EDGE('',*,*,#56,.F.); 84 | #68=ORIENTED_EDGE('',*,*,#57,.F.); 85 | #69=ORIENTED_EDGE('',*,*,#58,.F.); 86 | #70=ORIENTED_EDGE('',*,*,#55,.F.); 87 | #71=ORIENTED_EDGE('',*,*,#59,.F.); 88 | #72=ORIENTED_EDGE('',*,*,#58,.T.); 89 | #73=ORIENTED_EDGE('',*,*,#57,.T.); 90 | #74=ORIENTED_EDGE('',*,*,#56,.T.); 91 | #75=ORIENTED_EDGE('',*,*,#60,.F.); 92 | #76=ORIENTED_EDGE('',*,*,#60,.T.); 93 | #77=ORIENTED_EDGE('',*,*,#61,.F.); 94 | #78=ORIENTED_EDGE('',*,*,#62,.T.); 95 | #79=ORIENTED_EDGE('',*,*,#63,.T.); 96 | #80=ORIENTED_EDGE('',*,*,#62,.F.); 97 | #81=ORIENTED_EDGE('',*,*,#53,.T.); 98 | #82=ORIENTED_EDGE('',*,*,#59,.T.); 99 | #83=ORIENTED_EDGE('',*,*,#54,.T.); 100 | #84=ORIENTED_EDGE('',*,*,#61,.T.); 101 | #85=ORIENTED_EDGE('',*,*,#63,.F.); 102 | #86=CYLINDRICAL_SURFACE('',#109,30.); 103 | #87=CYLINDRICAL_SURFACE('',#116,30.); 104 | #88=CYLINDRICAL_SURFACE('',#119,30.); 105 | #89=ADVANCED_FACE('',(#22),#86,.T.); 106 | #90=ADVANCED_FACE('',(#23),#87,.T.); 107 | #91=ADVANCED_FACE('',(#24),#16,.T.); 108 | #92=ADVANCED_FACE('',(#25,#15),#88,.T.); 109 | #93=ADVANCED_FACE('',(#26),#17,.T.); 110 | #94=ADVANCED_FACE('',(#27),#18,.F.); 111 | #95=CLOSED_SHELL('',(#89,#90,#91,#92,#93,#94)); 112 | #96=DERIVED_UNIT_ELEMENT(#98,1.); 113 | #97=DERIVED_UNIT_ELEMENT(#189,3.); 114 | #98=( 115 | MASS_UNIT() 116 | NAMED_UNIT(*) 117 | SI_UNIT(.KILO.,.GRAM.) 118 | ); 119 | #99=DERIVED_UNIT((#96,#97)); 120 | #100=MEASURE_REPRESENTATION_ITEM('density measure', 121 | POSITIVE_RATIO_MEASURE(7850.),#99); 122 | #101=PROPERTY_DEFINITION_REPRESENTATION(#106,#103); 123 | #102=PROPERTY_DEFINITION_REPRESENTATION(#107,#104); 124 | #103=REPRESENTATION('material name',(#105),#186); 125 | #104=REPRESENTATION('density',(#100),#186); 126 | #105=DESCRIPTIVE_REPRESENTATION_ITEM('Steel','Steel'); 127 | #106=PROPERTY_DEFINITION('material property','material name',#196); 128 | #107=PROPERTY_DEFINITION('material property','density of part',#196); 129 | #108=AXIS2_PLACEMENT_3D('placement',#158,#124,#125); 130 | #109=AXIS2_PLACEMENT_3D('',#159,#126,#127); 131 | #110=AXIS2_PLACEMENT_3D('',#162,#128,#129); 132 | #111=AXIS2_PLACEMENT_3D('',#164,#130,#131); 133 | #112=AXIS2_PLACEMENT_3D('',#168,#133,#134); 134 | #113=AXIS2_PLACEMENT_3D('',#170,#135,#136); 135 | #114=AXIS2_PLACEMENT_3D('',#171,#137,#138); 136 | #115=AXIS2_PLACEMENT_3D('',#172,#139,#140); 137 | #116=AXIS2_PLACEMENT_3D('',#173,#141,#142); 138 | #117=AXIS2_PLACEMENT_3D('',#174,#143,#144); 139 | #118=AXIS2_PLACEMENT_3D('',#175,#145,#146); 140 | #119=AXIS2_PLACEMENT_3D('',#176,#147,#148); 141 | #120=AXIS2_PLACEMENT_3D('',#178,#149,#150); 142 | #121=AXIS2_PLACEMENT_3D('',#181,#152,#153); 143 | #122=AXIS2_PLACEMENT_3D('',#182,#154,#155); 144 | #123=AXIS2_PLACEMENT_3D('',#183,#156,#157); 145 | #124=DIRECTION('axis',(0.,0.,1.)); 146 | #125=DIRECTION('refdir',(1.,0.,0.)); 147 | #126=DIRECTION('center_axis',(-1.,-9.79094320929272E-16,0.)); 148 | #127=DIRECTION('ref_axis',(-9.79094320929272E-16,1.,0.)); 149 | #128=DIRECTION('center_axis',(-0.707106781186548,0.707106781186547,0.)); 150 | #129=DIRECTION('ref_axis',(0.707106781186547,0.707106781186548,0.)); 151 | #130=DIRECTION('center_axis',(-0.707106781186547,-0.707106781186548,0.)); 152 | #131=DIRECTION('ref_axis',(-0.707106781186548,0.707106781186547,0.)); 153 | #132=DIRECTION('',(1.,9.79094320929272E-16,0.)); 154 | #133=DIRECTION('center_axis',(0.707106781186548,-0.707106781186547,0.)); 155 | #134=DIRECTION('ref_axis',(0.707106781186547,0.707106781186548,0.)); 156 | #135=DIRECTION('center_axis',(0.707106781186548,-0.707106781186547,0.)); 157 | #136=DIRECTION('ref_axis',(0.707106781186547,0.707106781186548,0.)); 158 | #137=DIRECTION('center_axis',(0.707106781186548,-0.707106781186547,0.)); 159 | #138=DIRECTION('ref_axis',(0.707106781186547,0.707106781186548,0.)); 160 | #139=DIRECTION('center_axis',(-0.707106781186547,-0.707106781186548,0.)); 161 | #140=DIRECTION('ref_axis',(-0.707106781186548,0.707106781186547,0.)); 162 | #141=DIRECTION('center_axis',(0.,1.,0.)); 163 | #142=DIRECTION('ref_axis',(1.,0.,0.)); 164 | #143=DIRECTION('center_axis',(0.,-1.,0.)); 165 | #144=DIRECTION('ref_axis',(1.,0.,0.)); 166 | #145=DIRECTION('center_axis',(0.,-1.,0.)); 167 | #146=DIRECTION('ref_axis',(1.,0.,0.)); 168 | #147=DIRECTION('center_axis',(0.,1.,0.)); 169 | #148=DIRECTION('ref_axis',(1.,0.,0.)); 170 | #149=DIRECTION('center_axis',(0.,1.,0.)); 171 | #150=DIRECTION('ref_axis',(1.,0.,0.)); 172 | #151=DIRECTION('',(0.,-1.,0.)); 173 | #152=DIRECTION('center_axis',(0.,1.,0.)); 174 | #153=DIRECTION('ref_axis',(1.,0.,0.)); 175 | #154=DIRECTION('center_axis',(0.,1.,0.)); 176 | #155=DIRECTION('ref_axis',(1.,0.,0.)); 177 | #156=DIRECTION('center_axis',(0.,1.,0.)); 178 | #157=DIRECTION('ref_axis',(1.,0.,0.)); 179 | #158=CARTESIAN_POINT('',(0.,0.,0.)); 180 | #159=CARTESIAN_POINT('Origin',(341.558080232566,58.0000000000001,18.2140905642682)); 181 | #160=CARTESIAN_POINT('',(278.058080232566,57.9999999999999,48.2140905642682)); 182 | #161=CARTESIAN_POINT('',(278.058080232566,57.9999999999999,-11.7859094357318)); 183 | #162=CARTESIAN_POINT('Origin',(278.058080232566,58.,18.2140905642682)); 184 | #163=CARTESIAN_POINT('',(308.058080232566,28.,18.2140905642682)); 185 | #164=CARTESIAN_POINT('Origin',(278.058080232566,58.,18.2140905642682)); 186 | #165=CARTESIAN_POINT('',(311.558080232566,28.0000000000001,18.2140905642682)); 187 | #166=CARTESIAN_POINT('',(341.558080232566,28.0000000000001,18.2140905642682)); 188 | #167=CARTESIAN_POINT('',(341.558080232566,58.0000000000001,48.2140905642682)); 189 | #168=CARTESIAN_POINT('Origin',(341.558080232566,58.0000000000001,18.2140905642682)); 190 | #169=CARTESIAN_POINT('',(341.558080232566,58.0000000000001,-11.7859094357318)); 191 | #170=CARTESIAN_POINT('Origin',(341.558080232566,58.0000000000001,18.2140905642682)); 192 | #171=CARTESIAN_POINT('Origin',(341.558080232566,58.0000000000001,18.2140905642682)); 193 | #172=CARTESIAN_POINT('Origin',(278.058080232566,58.,18.2140905642682)); 194 | #173=CARTESIAN_POINT('Origin',(341.558080232566,28.0000000000001,18.2140905642682)); 195 | #174=CARTESIAN_POINT('Origin',(341.558080232566,28.0000000000001,18.2140905642682)); 196 | #175=CARTESIAN_POINT('Origin',(341.558080232566,28.0000000000001,18.2140905642682)); 197 | #176=CARTESIAN_POINT('Origin',(278.058080232566,0.,18.2140905642682)); 198 | #177=CARTESIAN_POINT('',(248.058080232566,116.,18.2140905642682)); 199 | #178=CARTESIAN_POINT('Origin',(278.058080232566,116.,18.2140905642682)); 200 | #179=CARTESIAN_POINT('',(248.058080232566,0.,18.2140905642682)); 201 | #180=CARTESIAN_POINT('',(248.058080232566,0.,18.2140905642682)); 202 | #181=CARTESIAN_POINT('Origin',(278.058080232566,0.,18.2140905642682)); 203 | #182=CARTESIAN_POINT('Origin',(278.058080232566,116.,18.2140905642682)); 204 | #183=CARTESIAN_POINT('Origin',(278.058080232566,0.,18.2140905642682)); 205 | #184=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#188, 206 | 'DISTANCE_ACCURACY_VALUE', 207 | 'Maximum model space distance between geometric entities at asserted c 208 | onnectivities'); 209 | #185=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#188, 210 | 'DISTANCE_ACCURACY_VALUE', 211 | 'Maximum model space distance between geometric entities at asserted c 212 | onnectivities'); 213 | #186=( 214 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 215 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#184)) 216 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#188,#191,#190)) 217 | REPRESENTATION_CONTEXT('','3D') 218 | ); 219 | #187=( 220 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 221 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#185)) 222 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#188,#191,#190)) 223 | REPRESENTATION_CONTEXT('','3D') 224 | ); 225 | #188=( 226 | LENGTH_UNIT() 227 | NAMED_UNIT(*) 228 | SI_UNIT(.MILLI.,.METRE.) 229 | ); 230 | #189=( 231 | LENGTH_UNIT() 232 | NAMED_UNIT(*) 233 | SI_UNIT($,.METRE.) 234 | ); 235 | #190=( 236 | NAMED_UNIT(*) 237 | SI_UNIT($,.STERADIAN.) 238 | SOLID_ANGLE_UNIT() 239 | ); 240 | #191=( 241 | NAMED_UNIT(*) 242 | PLANE_ANGLE_UNIT() 243 | SI_UNIT($,.RADIAN.) 244 | ); 245 | #192=SHAPE_DEFINITION_REPRESENTATION(#193,#194); 246 | #193=PRODUCT_DEFINITION_SHAPE('',$,#196); 247 | #194=SHAPE_REPRESENTATION('',(#108),#186); 248 | #195=PRODUCT_DEFINITION_CONTEXT('part definition',#200,'design'); 249 | #196=PRODUCT_DEFINITION('ShoulderPitch','ShoulderPitch',#197,#195); 250 | #197=PRODUCT_DEFINITION_FORMATION('',$,#202); 251 | #198=PRODUCT_RELATED_PRODUCT_CATEGORY('ShoulderPitch','ShoulderPitch',(#202)); 252 | #199=APPLICATION_PROTOCOL_DEFINITION('international standard', 253 | 'automotive_design',2009,#200); 254 | #200=APPLICATION_CONTEXT( 255 | 'Core Data for Automotive Mechanical Design Process'); 256 | #201=PRODUCT_CONTEXT('part definition',#200,'mechanical'); 257 | #202=PRODUCT('ShoulderPitch','ShoulderPitch',$,(#201)); 258 | #203=PRESENTATION_STYLE_ASSIGNMENT((#204)); 259 | #204=SURFACE_STYLE_USAGE(.BOTH.,#205); 260 | #205=SURFACE_SIDE_STYLE('',(#206)); 261 | #206=SURFACE_STYLE_FILL_AREA(#207); 262 | #207=FILL_AREA_STYLE('Steel - Satin',(#208)); 263 | #208=FILL_AREA_STYLE_COLOUR('Steel - Satin',#209); 264 | #209=COLOUR_RGB('Steel - Satin',0.627450980392157,0.627450980392157,0.627450980392157); 265 | ENDSEC; 266 | END-ISO-10303-21; 267 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/components/link40.stp: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | /* Generated by software containing ST-Developer 4 | * from STEP Tools, Inc. (www.steptools.com) 5 | */ 6 | 7 | FILE_DESCRIPTION( 8 | /* description */ (''), 9 | /* implementation_level */ '2;1'); 10 | 11 | FILE_NAME( 12 | /* name */ 13 | 'C:/Users/Frederico/OneDrive/Dokumenty/mypackage/components//link40.st 14 | p', 15 | /* time_stamp */ '2018-08-21T11:21:31+01:00', 16 | /* author */ (''), 17 | /* organization */ (''), 18 | /* preprocessor_version */ 'ST-DEVELOPER v17', 19 | /* originating_system */ 'Autodesk Translation Framework v7.1.0.215', 20 | /* authorisation */ ''); 21 | 22 | FILE_SCHEMA (('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 23 | ENDSEC; 24 | 25 | DATA; 26 | #10=MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#13),#86); 27 | #11=SHAPE_REPRESENTATION_RELATIONSHIP('SRR','None',#93,#12); 28 | #12=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#14),#85); 29 | #13=STYLED_ITEM('',(#102),#14); 30 | #14=MANIFOLD_SOLID_BREP('Body1',#42); 31 | #15=PLANE('',#59); 32 | #16=PLANE('',#60); 33 | #17=FACE_OUTER_BOUND('',#20,.T.); 34 | #18=FACE_OUTER_BOUND('',#21,.T.); 35 | #19=FACE_OUTER_BOUND('',#22,.T.); 36 | #20=EDGE_LOOP('',(#32,#33,#34,#35)); 37 | #21=EDGE_LOOP('',(#36)); 38 | #22=EDGE_LOOP('',(#37)); 39 | #23=LINE('',#79,#24); 40 | #24=VECTOR('',#67,30.); 41 | #25=CIRCLE('',#57,30.); 42 | #26=CIRCLE('',#58,30.); 43 | #27=VERTEX_POINT('',#76); 44 | #28=VERTEX_POINT('',#78); 45 | #29=EDGE_CURVE('',#27,#27,#25,.T.); 46 | #30=EDGE_CURVE('',#27,#28,#23,.T.); 47 | #31=EDGE_CURVE('',#28,#28,#26,.T.); 48 | #32=ORIENTED_EDGE('',*,*,#29,.F.); 49 | #33=ORIENTED_EDGE('',*,*,#30,.T.); 50 | #34=ORIENTED_EDGE('',*,*,#31,.T.); 51 | #35=ORIENTED_EDGE('',*,*,#30,.F.); 52 | #36=ORIENTED_EDGE('',*,*,#29,.T.); 53 | #37=ORIENTED_EDGE('',*,*,#31,.F.); 54 | #38=CYLINDRICAL_SURFACE('',#56,30.); 55 | #39=ADVANCED_FACE('',(#17),#38,.T.); 56 | #40=ADVANCED_FACE('',(#18),#15,.T.); 57 | #41=ADVANCED_FACE('',(#19),#16,.F.); 58 | #42=CLOSED_SHELL('',(#39,#40,#41)); 59 | #43=DERIVED_UNIT_ELEMENT(#45,1.); 60 | #44=DERIVED_UNIT_ELEMENT(#88,3.); 61 | #45=( 62 | MASS_UNIT() 63 | NAMED_UNIT(*) 64 | SI_UNIT(.KILO.,.GRAM.) 65 | ); 66 | #46=DERIVED_UNIT((#43,#44)); 67 | #47=MEASURE_REPRESENTATION_ITEM('density measure', 68 | POSITIVE_RATIO_MEASURE(7850.),#46); 69 | #48=PROPERTY_DEFINITION_REPRESENTATION(#53,#50); 70 | #49=PROPERTY_DEFINITION_REPRESENTATION(#54,#51); 71 | #50=REPRESENTATION('material name',(#52),#85); 72 | #51=REPRESENTATION('density',(#47),#85); 73 | #52=DESCRIPTIVE_REPRESENTATION_ITEM('Steel','Steel'); 74 | #53=PROPERTY_DEFINITION('material property','material name',#95); 75 | #54=PROPERTY_DEFINITION('material property','density of part',#95); 76 | #55=AXIS2_PLACEMENT_3D('placement',#74,#61,#62); 77 | #56=AXIS2_PLACEMENT_3D('',#75,#63,#64); 78 | #57=AXIS2_PLACEMENT_3D('',#77,#65,#66); 79 | #58=AXIS2_PLACEMENT_3D('',#80,#68,#69); 80 | #59=AXIS2_PLACEMENT_3D('',#81,#70,#71); 81 | #60=AXIS2_PLACEMENT_3D('',#82,#72,#73); 82 | #61=DIRECTION('axis',(0.,0.,1.)); 83 | #62=DIRECTION('refdir',(1.,0.,0.)); 84 | #63=DIRECTION('center_axis',(0.,1.,0.)); 85 | #64=DIRECTION('ref_axis',(1.,0.,0.)); 86 | #65=DIRECTION('center_axis',(0.,1.,0.)); 87 | #66=DIRECTION('ref_axis',(1.,0.,0.)); 88 | #67=DIRECTION('',(0.,-1.,0.)); 89 | #68=DIRECTION('center_axis',(0.,1.,0.)); 90 | #69=DIRECTION('ref_axis',(1.,0.,0.)); 91 | #70=DIRECTION('center_axis',(0.,1.,0.)); 92 | #71=DIRECTION('ref_axis',(1.,0.,0.)); 93 | #72=DIRECTION('center_axis',(0.,1.,0.)); 94 | #73=DIRECTION('ref_axis',(1.,0.,0.)); 95 | #74=CARTESIAN_POINT('',(0.,0.,0.)); 96 | #75=CARTESIAN_POINT('Origin',(184.3790102857,0.,50.0281880853679)); 97 | #76=CARTESIAN_POINT('',(154.3790102857,238.,50.0281880853679)); 98 | #77=CARTESIAN_POINT('Origin',(184.3790102857,238.,50.0281880853679)); 99 | #78=CARTESIAN_POINT('',(154.3790102857,0.,50.0281880853679)); 100 | #79=CARTESIAN_POINT('',(154.3790102857,0.,50.0281880853679)); 101 | #80=CARTESIAN_POINT('Origin',(184.3790102857,0.,50.0281880853679)); 102 | #81=CARTESIAN_POINT('Origin',(184.3790102857,238.,50.0281880853679)); 103 | #82=CARTESIAN_POINT('Origin',(184.3790102857,0.,50.0281880853679)); 104 | #83=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 105 | 'DISTANCE_ACCURACY_VALUE', 106 | 'Maximum model space distance between geometric entities at asserted c 107 | onnectivities'); 108 | #84=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 109 | 'DISTANCE_ACCURACY_VALUE', 110 | 'Maximum model space distance between geometric entities at asserted c 111 | onnectivities'); 112 | #85=( 113 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 114 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#83)) 115 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 116 | REPRESENTATION_CONTEXT('','3D') 117 | ); 118 | #86=( 119 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 120 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#84)) 121 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 122 | REPRESENTATION_CONTEXT('','3D') 123 | ); 124 | #87=( 125 | LENGTH_UNIT() 126 | NAMED_UNIT(*) 127 | SI_UNIT(.MILLI.,.METRE.) 128 | ); 129 | #88=( 130 | LENGTH_UNIT() 131 | NAMED_UNIT(*) 132 | SI_UNIT($,.METRE.) 133 | ); 134 | #89=( 135 | NAMED_UNIT(*) 136 | SI_UNIT($,.STERADIAN.) 137 | SOLID_ANGLE_UNIT() 138 | ); 139 | #90=( 140 | NAMED_UNIT(*) 141 | PLANE_ANGLE_UNIT() 142 | SI_UNIT($,.RADIAN.) 143 | ); 144 | #91=SHAPE_DEFINITION_REPRESENTATION(#92,#93); 145 | #92=PRODUCT_DEFINITION_SHAPE('',$,#95); 146 | #93=SHAPE_REPRESENTATION('',(#55),#85); 147 | #94=PRODUCT_DEFINITION_CONTEXT('part definition',#99,'design'); 148 | #95=PRODUCT_DEFINITION('UpperArmRoll','UpperArmRoll',#96,#94); 149 | #96=PRODUCT_DEFINITION_FORMATION('',$,#101); 150 | #97=PRODUCT_RELATED_PRODUCT_CATEGORY('UpperArmRoll','UpperArmRoll',(#101)); 151 | #98=APPLICATION_PROTOCOL_DEFINITION('international standard', 152 | 'automotive_design',2009,#99); 153 | #99=APPLICATION_CONTEXT( 154 | 'Core Data for Automotive Mechanical Design Process'); 155 | #100=PRODUCT_CONTEXT('part definition',#99,'mechanical'); 156 | #101=PRODUCT('UpperArmRoll','UpperArmRoll',$,(#100)); 157 | #102=PRESENTATION_STYLE_ASSIGNMENT((#103)); 158 | #103=SURFACE_STYLE_USAGE(.BOTH.,#104); 159 | #104=SURFACE_SIDE_STYLE('',(#105)); 160 | #105=SURFACE_STYLE_FILL_AREA(#106); 161 | #106=FILL_AREA_STYLE('Steel - Satin',(#107)); 162 | #107=FILL_AREA_STYLE_COLOUR('Steel - Satin',#108); 163 | #108=COLOUR_RGB('Steel - Satin',0.627450980392157,0.627450980392157,0.627450980392157); 164 | ENDSEC; 165 | END-ISO-10303-21; 166 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/components/link50.stp: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | /* Generated by software containing ST-Developer 4 | * from STEP Tools, Inc. (www.steptools.com) 5 | */ 6 | 7 | FILE_DESCRIPTION( 8 | /* description */ (''), 9 | /* implementation_level */ '2;1'); 10 | 11 | FILE_NAME( 12 | /* name */ 13 | 'C:/Users/Frederico/OneDrive/Dokumenty/mypackage/components//link50.st 14 | p', 15 | /* time_stamp */ '2018-08-21T11:21:32+01:00', 16 | /* author */ (''), 17 | /* organization */ (''), 18 | /* preprocessor_version */ 'ST-DEVELOPER v17', 19 | /* originating_system */ 'Autodesk Translation Framework v7.1.0.215', 20 | /* authorisation */ ''); 21 | 22 | FILE_SCHEMA (('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 23 | ENDSEC; 24 | 25 | DATA; 26 | #10=MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#13),#86); 27 | #11=SHAPE_REPRESENTATION_RELATIONSHIP('SRR','None',#93,#12); 28 | #12=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#14),#85); 29 | #13=STYLED_ITEM('',(#102),#14); 30 | #14=MANIFOLD_SOLID_BREP('Body1',#42); 31 | #15=PLANE('',#59); 32 | #16=PLANE('',#60); 33 | #17=FACE_OUTER_BOUND('',#20,.T.); 34 | #18=FACE_OUTER_BOUND('',#21,.T.); 35 | #19=FACE_OUTER_BOUND('',#22,.T.); 36 | #20=EDGE_LOOP('',(#32,#33,#34,#35)); 37 | #21=EDGE_LOOP('',(#36)); 38 | #22=EDGE_LOOP('',(#37)); 39 | #23=LINE('',#79,#24); 40 | #24=VECTOR('',#67,38.5); 41 | #25=CIRCLE('',#57,38.5); 42 | #26=CIRCLE('',#58,38.5); 43 | #27=VERTEX_POINT('',#76); 44 | #28=VERTEX_POINT('',#78); 45 | #29=EDGE_CURVE('',#27,#27,#25,.T.); 46 | #30=EDGE_CURVE('',#27,#28,#23,.T.); 47 | #31=EDGE_CURVE('',#28,#28,#26,.T.); 48 | #32=ORIENTED_EDGE('',*,*,#29,.F.); 49 | #33=ORIENTED_EDGE('',*,*,#30,.T.); 50 | #34=ORIENTED_EDGE('',*,*,#31,.T.); 51 | #35=ORIENTED_EDGE('',*,*,#30,.F.); 52 | #36=ORIENTED_EDGE('',*,*,#29,.T.); 53 | #37=ORIENTED_EDGE('',*,*,#31,.F.); 54 | #38=CYLINDRICAL_SURFACE('',#56,38.5); 55 | #39=ADVANCED_FACE('',(#17),#38,.T.); 56 | #40=ADVANCED_FACE('',(#18),#15,.T.); 57 | #41=ADVANCED_FACE('',(#19),#16,.F.); 58 | #42=CLOSED_SHELL('',(#39,#40,#41)); 59 | #43=DERIVED_UNIT_ELEMENT(#45,1.); 60 | #44=DERIVED_UNIT_ELEMENT(#88,3.); 61 | #45=( 62 | MASS_UNIT() 63 | NAMED_UNIT(*) 64 | SI_UNIT(.KILO.,.GRAM.) 65 | ); 66 | #46=DERIVED_UNIT((#43,#44)); 67 | #47=MEASURE_REPRESENTATION_ITEM('density measure', 68 | POSITIVE_RATIO_MEASURE(7850.),#46); 69 | #48=PROPERTY_DEFINITION_REPRESENTATION(#53,#50); 70 | #49=PROPERTY_DEFINITION_REPRESENTATION(#54,#51); 71 | #50=REPRESENTATION('material name',(#52),#85); 72 | #51=REPRESENTATION('density',(#47),#85); 73 | #52=DESCRIPTIVE_REPRESENTATION_ITEM('Steel','Steel'); 74 | #53=PROPERTY_DEFINITION('material property','material name',#95); 75 | #54=PROPERTY_DEFINITION('material property','density of part',#95); 76 | #55=AXIS2_PLACEMENT_3D('placement',#74,#61,#62); 77 | #56=AXIS2_PLACEMENT_3D('',#75,#63,#64); 78 | #57=AXIS2_PLACEMENT_3D('',#77,#65,#66); 79 | #58=AXIS2_PLACEMENT_3D('',#80,#68,#69); 80 | #59=AXIS2_PLACEMENT_3D('',#81,#70,#71); 81 | #60=AXIS2_PLACEMENT_3D('',#82,#72,#73); 82 | #61=DIRECTION('axis',(0.,0.,1.)); 83 | #62=DIRECTION('refdir',(1.,0.,0.)); 84 | #63=DIRECTION('center_axis',(0.,1.,0.)); 85 | #64=DIRECTION('ref_axis',(1.,0.,0.)); 86 | #65=DIRECTION('center_axis',(0.,1.,0.)); 87 | #66=DIRECTION('ref_axis',(1.,0.,0.)); 88 | #67=DIRECTION('',(0.,-1.,0.)); 89 | #68=DIRECTION('center_axis',(0.,1.,0.)); 90 | #69=DIRECTION('ref_axis',(1.,0.,0.)); 91 | #70=DIRECTION('center_axis',(0.,1.,0.)); 92 | #71=DIRECTION('ref_axis',(1.,0.,0.)); 93 | #72=DIRECTION('center_axis',(0.,1.,0.)); 94 | #73=DIRECTION('ref_axis',(1.,0.,0.)); 95 | #74=CARTESIAN_POINT('',(0.,0.,0.)); 96 | #75=CARTESIAN_POINT('Origin',(203.545416478593,0.,107.48229935588)); 97 | #76=CARTESIAN_POINT('',(165.045416478593,210.,107.48229935588)); 98 | #77=CARTESIAN_POINT('Origin',(203.545416478593,210.,107.48229935588)); 99 | #78=CARTESIAN_POINT('',(165.045416478593,0.,107.48229935588)); 100 | #79=CARTESIAN_POINT('',(165.045416478593,0.,107.48229935588)); 101 | #80=CARTESIAN_POINT('Origin',(203.545416478593,0.,107.48229935588)); 102 | #81=CARTESIAN_POINT('Origin',(203.545416478593,210.,107.48229935588)); 103 | #82=CARTESIAN_POINT('Origin',(203.545416478593,0.,107.48229935588)); 104 | #83=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 105 | 'DISTANCE_ACCURACY_VALUE', 106 | 'Maximum model space distance between geometric entities at asserted c 107 | onnectivities'); 108 | #84=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#87, 109 | 'DISTANCE_ACCURACY_VALUE', 110 | 'Maximum model space distance between geometric entities at asserted c 111 | onnectivities'); 112 | #85=( 113 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 114 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#83)) 115 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 116 | REPRESENTATION_CONTEXT('','3D') 117 | ); 118 | #86=( 119 | GEOMETRIC_REPRESENTATION_CONTEXT(3) 120 | GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#84)) 121 | GLOBAL_UNIT_ASSIGNED_CONTEXT((#87,#90,#89)) 122 | REPRESENTATION_CONTEXT('','3D') 123 | ); 124 | #87=( 125 | LENGTH_UNIT() 126 | NAMED_UNIT(*) 127 | SI_UNIT(.MILLI.,.METRE.) 128 | ); 129 | #88=( 130 | LENGTH_UNIT() 131 | NAMED_UNIT(*) 132 | SI_UNIT($,.METRE.) 133 | ); 134 | #89=( 135 | NAMED_UNIT(*) 136 | SI_UNIT($,.STERADIAN.) 137 | SOLID_ANGLE_UNIT() 138 | ); 139 | #90=( 140 | NAMED_UNIT(*) 141 | PLANE_ANGLE_UNIT() 142 | SI_UNIT($,.RADIAN.) 143 | ); 144 | #91=SHAPE_DEFINITION_REPRESENTATION(#92,#93); 145 | #92=PRODUCT_DEFINITION_SHAPE('',$,#95); 146 | #93=SHAPE_REPRESENTATION('',(#55),#85); 147 | #94=PRODUCT_DEFINITION_CONTEXT('part definition',#99,'design'); 148 | #95=PRODUCT_DEFINITION('LowerLimb','LowerLimb',#96,#94); 149 | #96=PRODUCT_DEFINITION_FORMATION('',$,#101); 150 | #97=PRODUCT_RELATED_PRODUCT_CATEGORY('LowerLimb','LowerLimb',(#101)); 151 | #98=APPLICATION_PROTOCOL_DEFINITION('international standard', 152 | 'automotive_design',2009,#99); 153 | #99=APPLICATION_CONTEXT( 154 | 'Core Data for Automotive Mechanical Design Process'); 155 | #100=PRODUCT_CONTEXT('part definition',#99,'mechanical'); 156 | #101=PRODUCT('LowerLimb','LowerLimb',$,(#100)); 157 | #102=PRESENTATION_STYLE_ASSIGNMENT((#103)); 158 | #103=SURFACE_STYLE_USAGE(.BOTH.,#104); 159 | #104=SURFACE_SIDE_STYLE('',(#105)); 160 | #105=SURFACE_STYLE_FILL_AREA(#106); 161 | #106=FILL_AREA_STYLE('Steel - Satin',(#107)); 162 | #107=FILL_AREA_STYLE_COLOUR('Steel - Satin',#108); 163 | #108=COLOUR_RGB('Steel - Satin',0.627450980392157,0.627450980392157,0.627450980392157); 164 | ENDSEC; 165 | END-ISO-10303-21; 166 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/display.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 11 | 14 | 18 | 22 | 27 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/meshes/base.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GummiArmCE/fusion360_scripts/59288c2f43f360a99572d71239cc612703574a73/urdf_generator/mypackage/meshes/base.stl -------------------------------------------------------------------------------- /urdf_generator/mypackage/meshes/link1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GummiArmCE/fusion360_scripts/59288c2f43f360a99572d71239cc612703574a73/urdf_generator/mypackage/meshes/link1.stl -------------------------------------------------------------------------------- /urdf_generator/mypackage/meshes/link2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GummiArmCE/fusion360_scripts/59288c2f43f360a99572d71239cc612703574a73/urdf_generator/mypackage/meshes/link2.stl -------------------------------------------------------------------------------- /urdf_generator/mypackage/meshes/link3.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GummiArmCE/fusion360_scripts/59288c2f43f360a99572d71239cc612703574a73/urdf_generator/mypackage/meshes/link3.stl -------------------------------------------------------------------------------- /urdf_generator/mypackage/meshes/link4.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GummiArmCE/fusion360_scripts/59288c2f43f360a99572d71239cc612703574a73/urdf_generator/mypackage/meshes/link4.stl -------------------------------------------------------------------------------- /urdf_generator/mypackage/meshes/link5.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GummiArmCE/fusion360_scripts/59288c2f43f360a99572d71239cc612703574a73/urdf_generator/mypackage/meshes/link5.stl -------------------------------------------------------------------------------- /urdf_generator/mypackage/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | mypackage 4 | 0.0.0 5 | The mypackage package 6 | 7 | 8 | 9 | 10 | your_name 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | catkin 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/robot.urdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /urdf_generator/mypackage/urdf_.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz/Displays 3 | Help Height: 78 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | - /Status1 9 | Splitter Ratio: 0.5 10 | Tree Height: 775 11 | - Class: rviz/Selection 12 | Name: Selection 13 | - Class: rviz/Tool Properties 14 | Expanded: 15 | - /2D Pose Estimate1 16 | - /2D Nav Goal1 17 | - /Publish Point1 18 | Name: Tool Properties 19 | Splitter Ratio: 0.588679016 20 | - Class: rviz/Views 21 | Expanded: 22 | - /Current View1 23 | Name: Views 24 | Splitter Ratio: 0.5 25 | - Class: rviz/Time 26 | Experimental: false 27 | Name: Time 28 | SyncMode: 0 29 | SyncSource: "" 30 | Visualization Manager: 31 | Class: "" 32 | Displays: 33 | - Alpha: 0.5 34 | Cell Size: 1 35 | Class: rviz/Grid 36 | Color: 160; 160; 164 37 | Enabled: true 38 | Line Style: 39 | Line Width: 0.0299999993 40 | Value: Lines 41 | Name: Grid 42 | Normal Cell Count: 0 43 | Offset: 44 | X: 0 45 | Y: 0 46 | Z: 0 47 | Plane: XY 48 | Plane Cell Count: 10 49 | Reference Frame: 50 | Value: true 51 | - Alpha: 1 52 | Class: rviz/RobotModel 53 | Collision Enabled: false 54 | Enabled: true 55 | Links: 56 | All Links Enabled: true 57 | Expand Joint Details: false 58 | Expand Link Details: false 59 | Expand Tree: false 60 | Link Tree Style: Links in Alphabetic Order 61 | 62 | Name: RobotModel 63 | Robot Description: robot_description 64 | TF Prefix: "" 65 | Update Interval: 0 66 | Value: true 67 | Visual Enabled: true 68 | Enabled: true 69 | Global Options: 70 | Background Color: 48; 48; 48 71 | Fixed Frame: base_link 72 | Frame Rate: 30 73 | Name: root 74 | Tools: 75 | - Class: rviz/Interact 76 | Hide Inactive Objects: true 77 | - Class: rviz/MoveCamera 78 | - Class: rviz/Select 79 | - Class: rviz/FocusCamera 80 | - Class: rviz/Measure 81 | - Class: rviz/SetInitialPose 82 | Topic: /initialpose 83 | - Class: rviz/SetGoal 84 | Topic: /move_base_simple/goal 85 | - Class: rviz/PublishPoint 86 | Single click: true 87 | Topic: /clicked_point 88 | Value: true 89 | Views: 90 | Current: 91 | Class: rviz/Orbit 92 | Distance: 0.967690885 93 | Enable Stereo Rendering: 94 | Stereo Eye Separation: 0.0599999987 95 | Stereo Focal Distance: 1 96 | Swap Stereo Eyes: false 97 | Value: false 98 | Focal Point: 99 | X: -0.0163527969 100 | Y: -0.152750716 101 | Z: -0.00762194395 102 | Focal Shape Fixed Size: true 103 | Focal Shape Size: 0.0500000007 104 | Name: Current View 105 | Near Clip Distance: 0.00999999978 106 | Pitch: 0.190398335 107 | Target Frame: 108 | Value: Orbit (rviz) 109 | Yaw: 6.02856731 110 | Saved: ~ 111 | Window Geometry: 112 | Displays: 113 | collapsed: false 114 | Height: 1056 115 | Hide Left Dock: false 116 | Hide Right Dock: false 117 | QMainWindow State: 000000ff00000000fd00000004000000000000016a00000396fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006400fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002800000396000000dd00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000396fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000002800000396000000b000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003efc0100000002fb0000000800540069006d006501000000000000073f0000030000fffffffb0000000800540069006d00650100000000000004500000000000000000000004ba0000039600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 118 | Selection: 119 | collapsed: false 120 | Time: 121 | collapsed: false 122 | Tool Properties: 123 | collapsed: false 124 | Views: 125 | collapsed: false 126 | Width: 1855 127 | X: 65 128 | Y: 24 129 | -------------------------------------------------------------------------------- /urdf_generator/resources/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(somepackage) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED) 11 | 12 | ## System dependencies are found with CMake's conventions 13 | # find_package(Boost REQUIRED COMPONENTS system) 14 | 15 | 16 | ## Uncomment this if the package has a setup.py. This macro ensures 17 | ## modules and global scripts declared therein get installed 18 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 19 | # catkin_python_setup() 20 | 21 | ################################################ 22 | ## Declare ROS messages, services and actions ## 23 | ################################################ 24 | 25 | ## To declare and build messages, services or actions from within this 26 | ## package, follow these steps: 27 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 28 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 29 | ## * In the file package.xml: 30 | ## * add a build_depend tag for "message_generation" 31 | ## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET 32 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 33 | ## but can be declared for certainty nonetheless: 34 | ## * add a exec_depend tag for "message_runtime" 35 | ## * In this file (CMakeLists.txt): 36 | ## * add "message_generation" and every package in MSG_DEP_SET to 37 | ## find_package(catkin REQUIRED COMPONENTS ...) 38 | ## * add "message_runtime" and every package in MSG_DEP_SET to 39 | ## catkin_package(CATKIN_DEPENDS ...) 40 | ## * uncomment the add_*_files sections below as needed 41 | ## and list every .msg/.srv/.action file to be processed 42 | ## * uncomment the generate_messages entry below 43 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 44 | 45 | ## Generate messages in the 'msg' folder 46 | # add_message_files( 47 | # FILES 48 | # Message1.msg 49 | # Message2.msg 50 | # ) 51 | 52 | ## Generate services in the 'srv' folder 53 | # add_service_files( 54 | # FILES 55 | # Service1.srv 56 | # Service2.srv 57 | # ) 58 | 59 | ## Generate actions in the 'action' folder 60 | # add_action_files( 61 | # FILES 62 | # Action1.action 63 | # Action2.action 64 | # ) 65 | 66 | ## Generate added messages and services with any dependencies listed here 67 | # generate_messages( 68 | # DEPENDENCIES 69 | # std_msgs # Or other packages containing msgs 70 | # ) 71 | 72 | ################################################ 73 | ## Declare ROS dynamic reconfigure parameters ## 74 | ################################################ 75 | 76 | ## To declare and build dynamic reconfigure parameters within this 77 | ## package, follow these steps: 78 | ## * In the file package.xml: 79 | ## * add a build_depend and a exec_depend tag for "dynamic_reconfigure" 80 | ## * In this file (CMakeLists.txt): 81 | ## * add "dynamic_reconfigure" to 82 | ## find_package(catkin REQUIRED COMPONENTS ...) 83 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 84 | ## and list every .cfg file to be processed 85 | 86 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 87 | # generate_dynamic_reconfigure_options( 88 | # cfg/DynReconf1.cfg 89 | # cfg/DynReconf2.cfg 90 | # ) 91 | 92 | ################################### 93 | ## catkin specific configuration ## 94 | ################################### 95 | ## The catkin_package macro generates cmake config files for your package 96 | ## Declare things to be passed to dependent projects 97 | ## INCLUDE_DIRS: uncomment this if your package contains header files 98 | ## LIBRARIES: libraries you create in this project that dependent projects also need 99 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 100 | ## DEPENDS: system dependencies of this project that dependent projects also need 101 | catkin_package( 102 | # INCLUDE_DIRS include 103 | # LIBRARIES somepackage 104 | # CATKIN_DEPENDS other_catkin_pkg 105 | # DEPENDS system_lib 106 | ) 107 | 108 | ########### 109 | ## Build ## 110 | ########### 111 | 112 | ## Specify additional locations of header files 113 | ## Your package locations should be listed before other locations 114 | include_directories( 115 | # include 116 | # ${catkin_INCLUDE_DIRS} 117 | ) 118 | 119 | ## Declare a C++ library 120 | # add_library(${PROJECT_NAME} 121 | # src/${PROJECT_NAME}/somepackage.cpp 122 | # ) 123 | 124 | ## Add cmake target dependencies of the library 125 | ## as an example, code may need to be generated before libraries 126 | ## either from message generation or dynamic reconfigure 127 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 128 | 129 | ## Declare a C++ executable 130 | ## With catkin_make all packages are built within a single CMake context 131 | ## The recommended prefix ensures that target names across packages don't collide 132 | # add_executable(${PROJECT_NAME}_node src/somepackage_node.cpp) 133 | 134 | ## Rename C++ executable without prefix 135 | ## The above recommended prefix causes long target names, the following renames the 136 | ## target back to the shorter version for ease of user use 137 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 138 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 139 | 140 | ## Add cmake target dependencies of the executable 141 | ## same as for the library above 142 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 143 | 144 | ## Specify libraries to link a library or executable target against 145 | # target_link_libraries(${PROJECT_NAME}_node 146 | # ${catkin_LIBRARIES} 147 | # ) 148 | 149 | ############# 150 | ## Install ## 151 | ############# 152 | 153 | # all install targets should use catkin DESTINATION variables 154 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 155 | 156 | ## Mark executable scripts (Python etc.) for installation 157 | ## in contrast to setup.py, you can choose the destination 158 | # install(PROGRAMS 159 | # scripts/my_python_script 160 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 161 | # ) 162 | 163 | ## Mark executables and/or libraries for installation 164 | # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node 165 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 166 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 167 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 168 | # ) 169 | 170 | ## Mark cpp header files for installation 171 | # install(DIRECTORY include/${PROJECT_NAME}/ 172 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 173 | # FILES_MATCHING PATTERN "*.h" 174 | # PATTERN ".svn" EXCLUDE 175 | # ) 176 | 177 | ## Mark other files for installation (e.g. launch and bag files, etc.) 178 | # install(FILES 179 | # # myfile1 180 | # # myfile2 181 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 182 | # ) 183 | 184 | ############# 185 | ## Testing ## 186 | ############# 187 | 188 | ## Add gtest based cpp test target and link libraries 189 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_somepackage.cpp) 190 | # if(TARGET ${PROJECT_NAME}-test) 191 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 192 | # endif() 193 | 194 | ## Add folders to be run by python nosetests 195 | # catkin_add_nosetests(test) -------------------------------------------------------------------------------- /urdf_generator/resources/display.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 11 | 14 | 18 | 22 | 27 | -------------------------------------------------------------------------------- /urdf_generator/resources/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | somepackage 4 | 0.0.0 5 | The somepackage package 6 | 7 | 8 | 9 | 10 | your_name 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | catkin 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /urdf_generator/resources/urdf_.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz/Displays 3 | Help Height: 78 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | - /Status1 9 | Splitter Ratio: 0.5 10 | Tree Height: 775 11 | - Class: rviz/Selection 12 | Name: Selection 13 | - Class: rviz/Tool Properties 14 | Expanded: 15 | - /2D Pose Estimate1 16 | - /2D Nav Goal1 17 | - /Publish Point1 18 | Name: Tool Properties 19 | Splitter Ratio: 0.588679016 20 | - Class: rviz/Views 21 | Expanded: 22 | - /Current View1 23 | Name: Views 24 | Splitter Ratio: 0.5 25 | - Class: rviz/Time 26 | Experimental: false 27 | Name: Time 28 | SyncMode: 0 29 | SyncSource: "" 30 | Visualization Manager: 31 | Class: "" 32 | Displays: 33 | - Alpha: 0.5 34 | Cell Size: 1 35 | Class: rviz/Grid 36 | Color: 160; 160; 164 37 | Enabled: true 38 | Line Style: 39 | Line Width: 0.0299999993 40 | Value: Lines 41 | Name: Grid 42 | Normal Cell Count: 0 43 | Offset: 44 | X: 0 45 | Y: 0 46 | Z: 0 47 | Plane: XY 48 | Plane Cell Count: 10 49 | Reference Frame: 50 | Value: true 51 | - Alpha: 1 52 | Class: rviz/RobotModel 53 | Collision Enabled: false 54 | Enabled: true 55 | Links: 56 | All Links Enabled: true 57 | Expand Joint Details: false 58 | Expand Link Details: false 59 | Expand Tree: false 60 | Link Tree Style: Links in Alphabetic Order 61 | 62 | Name: RobotModel 63 | Robot Description: robot_description 64 | TF Prefix: "" 65 | Update Interval: 0 66 | Value: true 67 | Visual Enabled: true 68 | Enabled: true 69 | Global Options: 70 | Background Color: 48; 48; 48 71 | Fixed Frame: base_link 72 | Frame Rate: 30 73 | Name: root 74 | Tools: 75 | - Class: rviz/Interact 76 | Hide Inactive Objects: true 77 | - Class: rviz/MoveCamera 78 | - Class: rviz/Select 79 | - Class: rviz/FocusCamera 80 | - Class: rviz/Measure 81 | - Class: rviz/SetInitialPose 82 | Topic: /initialpose 83 | - Class: rviz/SetGoal 84 | Topic: /move_base_simple/goal 85 | - Class: rviz/PublishPoint 86 | Single click: true 87 | Topic: /clicked_point 88 | Value: true 89 | Views: 90 | Current: 91 | Class: rviz/Orbit 92 | Distance: 0.967690885 93 | Enable Stereo Rendering: 94 | Stereo Eye Separation: 0.0599999987 95 | Stereo Focal Distance: 1 96 | Swap Stereo Eyes: false 97 | Value: false 98 | Focal Point: 99 | X: -0.0163527969 100 | Y: -0.152750716 101 | Z: -0.00762194395 102 | Focal Shape Fixed Size: true 103 | Focal Shape Size: 0.0500000007 104 | Name: Current View 105 | Near Clip Distance: 0.00999999978 106 | Pitch: 0.190398335 107 | Target Frame: 108 | Value: Orbit (rviz) 109 | Yaw: 6.02856731 110 | Saved: ~ 111 | Window Geometry: 112 | Displays: 113 | collapsed: false 114 | Height: 1056 115 | Hide Left Dock: false 116 | Hide Right Dock: false 117 | QMainWindow State: 000000ff00000000fd00000004000000000000016a00000396fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006400fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002800000396000000dd00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000396fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000002800000396000000b000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003efc0100000002fb0000000800540069006d006501000000000000073f0000030000fffffffb0000000800540069006d00650100000000000004500000000000000000000004ba0000039600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 118 | Selection: 119 | collapsed: false 120 | Time: 121 | collapsed: false 122 | Tool Properties: 123 | collapsed: false 124 | Views: 125 | collapsed: false 126 | Width: 1855 127 | X: 65 128 | Y: 24 129 | -------------------------------------------------------------------------------- /urdf_generator/urdf-addin.py: -------------------------------------------------------------------------------- 1 | #Author- Frederico B. Klein 2 | #Description- URDFGEN command - somewhat functional. 3 | import adsk.core, adsk.fusion, traceback 4 | import xml.etree.cElementTree as etree 5 | import xml.dom.minidom # for prettying it.... 6 | import inspect 7 | import logging 8 | import re 9 | import os , sys 10 | #from copy import deepcopy ### pickle cant copy any swig object... 11 | 12 | _app = None 13 | _ui = None 14 | _design = None 15 | 16 | runfrommenu = True 17 | 18 | # Global set of event handlers to keep them referenced for the duration of the command 19 | _handlers = [] 20 | _ms = [] 21 | 22 | PI = 3.14159265359 23 | 24 | class MotherShip: 25 | def __init__(self): 26 | # """ This is just to clear bad globals that I shouldn't keep between 27 | # different runs. It is NOT a solution, mostly laziness, 28 | # but since the structure of some objects is not entirely clear just yet, 29 | # I don't dare doing more than this. """ 30 | self.rowNumber = 0 31 | self.elnum = 0 32 | self.oldrow = -1 33 | #damn globals! 34 | self.jtctrl = None 35 | self.lastjoint = None 36 | self.packagename = 'mypackage' 37 | self.numoflinks = -1 38 | self.numofjoints = -1 39 | self.thistree = UrdfTree() 40 | 41 | class UrdfTree: 42 | def __init__(self): 43 | self.elementsdict = {} 44 | self.currentel = None 45 | #self.placedlinks = [] 46 | 47 | def addLink(self, linkname,linknum): 48 | thislink = Link(linkname,linknum) 49 | self.elementsdict.update({linknum:thislink}) 50 | 51 | def addJoint(self, jointname,jointnum): 52 | thisjoint = Joint(jointname,jointnum) 53 | self.elementsdict.update({jointnum:thisjoint}) 54 | 55 | def rmElement(self,linknumstr): 56 | linknum = int(linknumstr) 57 | logging.debug('deleted element' + str(linknum)+ 'named: '+ self.elementsdict[linknum].name) 58 | self.elementsdict.pop(linknum) 59 | global _ms 60 | _ms.rowNumber -=1 61 | #logging.warn('this is not properly implemented. results are unpredictable after this operation!') 62 | 63 | def _gentreefindbase(self, thiselementsdict, report): 64 | placedlinks = {} 65 | foundbase = False 66 | for el in self.elementsdict: 67 | if 'isLink' in dir(self.elementsdict[el]) and self.elementsdict[el].isLink and self.elementsdict[el].name == 'base': 68 | foundbase = True 69 | msg = 'found my base when testing. base is on row' + str(self.elementsdict[el].row) 70 | logging.debug(msg) 71 | report += msg +'\n' 72 | ### base is zero, so its coordinate system is correctly set, we just need to change the isset property 73 | self.elementsdict[el].coordinatesystem.isset = True 74 | ### adding base to placedlink list 75 | placedlinks.update({0:self.elementsdict[el]}) 76 | assert placedlinks[0].coordinatesystem.isset 77 | thiselementsdict.pop(el) 78 | break 79 | if not foundbase: 80 | report += 'did not find base!' +'\n' 81 | logging.error('did not find base! the root link should have this name or a proper tree cannot be build. error ') 82 | return placedlinks, thiselementsdict, report 83 | 84 | def gentree(self): 85 | logging.info('\nstarted gentree!\n') 86 | #report = '' 87 | #thiselementsdict = deepcopy(self.elementsdict) 88 | thiselementsdict = {} 89 | 90 | for el in self.elementsdict: 91 | thiselementsdict.update({el:self.elementsdict[el]}) 92 | #### i am going to use this opportunity to check if links have a group 93 | if 'isLink' in dir(self.elementsdict[el]) and self.elementsdict[el].isLink: 94 | if not self.elementsdict[el].group: 95 | report = 'found an empty group. virtual links are currently not supported. this will fail to build correct urdf!' 96 | logging.error(report) 97 | _ui.messageBox(report) ### or i could have used assert and did it all in one line... 98 | 99 | placedlinks, thiselementsdict, report = self._gentreefindbase(thiselementsdict, '') 100 | assert placedlinks[0].coordinatesystem.isset 101 | 102 | something = True 103 | while something: 104 | placedjoints, placedeldic, thiselementsdict, myrep = self._findjoints(placedlinks, thiselementsdict) 105 | report += myrep 106 | if placedjoints: 107 | thiselementsdict, placedeldic, myrep = self._gentreecore(placedjoints, thiselementsdict, placedeldic) 108 | report += myrep 109 | else: 110 | something = False 111 | if thiselementsdict: ### after finishing this, thiseldict should be empty, if it isn't we have disconnected joints or links. 112 | message = str(len(thiselementsdict)) + ' floating elements found. This tree is not correct, please review your work!' 113 | report += message 114 | logging.warn(message) 115 | 116 | _ui.messageBox(report+'\n') 117 | logging.debug( str(placedeldic)+'\n'+str(self.elementsdict)) 118 | 119 | ### placedeldic should have a sequence of joints and links that are not a tree, but close looking to it, 120 | ### i forgot to set the link's parent joint, needed to remove the offset. but it should be easy to find it now. 121 | 122 | 123 | 124 | def _gentreecore(self, placedjoints, thiselementsdict, placedeldic): 125 | #nextlinkstoplace = [] 126 | report = '' 127 | for joint in placedjoints: 128 | #nextlinkstoplace.append(joint.childlink) 129 | stillmerging = True 130 | while stillmerging: 131 | stillmerging, placedjoints, thiselementsdict, placedeldic, report = self._gentreecorecore(placedjoints, thiselementsdict, placedeldic, report, joint) 132 | 133 | return thiselementsdict, placedeldic, report 134 | 135 | 136 | def _gentreecorecore(self, placedjoints, thiselementsdict, placedeldic, report, joint): 137 | stillmerging = False 138 | for el in thiselementsdict: 139 | if 'isLink' in dir(thiselementsdict[el]) and thiselementsdict[el].isLink and thiselementsdict[el].name == joint.childlink: 140 | ### if childlink in placedeldic then it is a closed chain! 141 | ### add it to placed elements 142 | placedeldic.update({len(placedeldic):thiselementsdict[el]}) 143 | ### add placed links to report 144 | report += 'placed a link named:' +thiselementsdict[el].name + ' because joint named:' + joint.name + ' told me to!\n' 145 | ### need to set this joint as father of link thiselementsdict[el], but not on this reduced dictionary we are iterating, but on the main dic: self.elementsdict, which will be used to generate the urdf 146 | self._genfatherjoint(thiselementsdict[el].name, joint) 147 | ## pop it from this elements dict out of the loop (see couple of lines below) 148 | stillmerging = True 149 | break 150 | if stillmerging: 151 | thiselementsdict.pop(el) # here! 152 | return stillmerging, placedjoints, thiselementsdict, placedeldic, report 153 | 154 | 155 | def _genfatherjoint(self, linkname, joint): 156 | for el in self.elementsdict: 157 | if self.elementsdict[el].name == linkname: 158 | ### found my link 159 | self.elementsdict[el].genfatherjoint(joint) 160 | 161 | def _findjointscore(self, placedeldic, thiselementsdict): 162 | _,_, allplacedlinks = self._allLinks( placedeldic) 163 | 164 | myjoint = None 165 | el = None 166 | for el in thiselementsdict: 167 | if 'isJoint' in dir(thiselementsdict[el]) and thiselementsdict[el].isJoint: 168 | ### here is the place to look for whether parent and child are flipped. I will not do it, I will assume the person creating the thing is smart 169 | ### i can also check for closed loops as well (but that would be harder...) 170 | if thiselementsdict[el].parentlink in allplacedlinks: 171 | myjoint = thiselementsdict[el] 172 | #### actually this may seem like a rather weird way to do this, but I don't want to recode this function 173 | for elel in placedeldic: 174 | if thiselementsdict[el].parentlink == placedeldic[elel].name: 175 | ### then placedeldic[elel] is my link 176 | ### if i did this correctly, the father link will already have a set coordinatesystem 177 | logging.debug('placed link is ' + placedeldic[elel].name) 178 | assert placedeldic[elel].coordinatesystem.isset 179 | 180 | myjoint.setrealorigin(placedeldic[elel].coordinatesystem) 181 | break 182 | return myjoint, el 183 | 184 | def _findjoints(self, placedeldic, thiselementsdict): 185 | foundjoints = [] 186 | something = True 187 | report = '' 188 | while something: 189 | joint, eltopop = self._findjointscore(placedeldic, thiselementsdict) 190 | if joint is None: 191 | something = False 192 | else: 193 | foundjoints.append(joint) 194 | thiselementsdict.pop(eltopop) 195 | placedeldic.update({len(placedeldic):joint}) 196 | report += 'placed joint:'+ joint.name + '\n' 197 | return foundjoints, placedeldic, thiselementsdict, report 198 | 199 | 200 | def _allLinks(self,whicheldict): 201 | exstr = '' 202 | nolinks = True 203 | alllinks = [] 204 | alllinknames = [] 205 | for el in whicheldict: 206 | if 'isLink' in dir(whicheldict[el]) and whicheldict[el].isLink: 207 | exstr = exstr +'link: ' + whicheldict[el].name + '\n' 208 | alllinknames.append(whicheldict[el].name) 209 | alllinks.append(whicheldict[el]) 210 | nolinks = False 211 | if nolinks: 212 | exstr = 'no links!' 213 | return exstr,alllinks, alllinknames 214 | 215 | def allLinks(self): 216 | exstr,alllinks,_ = self._allLinks(self.elementsdict) 217 | return exstr,alllinks 218 | 219 | def allJoints(self): 220 | exstr,alljoints,_ = self._allJoints(self.elementsdict) 221 | return exstr,alljoints 222 | 223 | def _allJoints(self, selfelementsdict): 224 | exstr = '' 225 | nojoints = True 226 | alljoints = [] 227 | alljointnames = [] 228 | for el in selfelementsdict: 229 | if 'isJoint' in dir(selfelementsdict[el]) and selfelementsdict[el].isJoint: 230 | exstr = exstr +'joint: ' + selfelementsdict[el].name + '\n' 231 | alljoints.append(selfelementsdict[el]) 232 | alljointnames.append( selfelementsdict[el].name) 233 | nojoints = False 234 | if nojoints: 235 | exstr = 'no joints!' 236 | return exstr,alljoints, alljointnames 237 | 238 | def allElements(self): 239 | exstr = '' 240 | noels = True 241 | allels = [] 242 | for el in self.elementsdict: 243 | if 'isJoint' in dir(self.elementsdict[el]) and self.elementsdict[el].isJoint: 244 | namename = 'joint: ' 245 | elif 'isLink' in dir(self.elementsdict[el]) and self.elementsdict[el].isLink: 246 | namename = 'link: ' 247 | else: 248 | namename = 'unk: ' 249 | exstr = exstr + namename + self.elementsdict[el].name + '\n' 250 | allels.append(self.elementsdict[el]) 251 | noels = False 252 | if noels: 253 | exstr = 'no elements!' 254 | return exstr,allels 255 | 256 | def getel(self,selected): 257 | logging.debug('selected' + str(selected)) 258 | logging.debug('len...' + str(len(self.elementsdict))) 259 | if selected not in self.elementsdict: 260 | return None 261 | else: 262 | logging.debug('dic...' + str(self.elementsdict)) 263 | ## is it in the dict though? 264 | return self.elementsdict[selected] 265 | def getcurrenteldesc(self): 266 | if self.currentel is None: 267 | return 'No current element' 268 | else: 269 | return self.currentel.name +'\n' + self.currentel.getitems() 270 | 271 | def setcurrentel(self,crnum): 272 | thisel = self.getel(crnum) 273 | if thisel is not None: 274 | self.currentel = thisel 275 | 276 | 277 | class Inertial: 278 | def __init__(self): 279 | self.origin = OrVec() 280 | self.mass = '0' 281 | self.inertia = Inertia() 282 | 283 | class Inertia: 284 | def __init__(self): 285 | self.ixx = '0' 286 | self.ixy = '0' 287 | self.ixz = '0' 288 | self.iyy = '0' 289 | self.iyz = '0' 290 | self.izz = '0' 291 | 292 | class OrVec: 293 | def __init__(self): 294 | #self.xyz = '0 0 0' 295 | #self.rpy = '0 0 0' 296 | #self.x = 0 297 | #self.z = 0 298 | #self.y = 0 299 | #self.r = 0 300 | #self.p = 0 301 | #self.yaw = 0 302 | self.setxyz(0,0,0) 303 | self.setrpy(0,0,0) 304 | 305 | self.isset = False 306 | def setxyz(self,x,y,z): 307 | self.isset = True 308 | self.xyz = str(x/100)+' ' + str(y/100)+' ' + str(z/100) ### the internal representation of joint occurrences offsets seems to be in cm no matter what you change the units to be. this needs to be checked, but i think it is always like this. if you are reading this line and wondering if this is the reason why your assembly looks like it exploded, then I was wrong... 309 | ### there will be inconsistencies here and if you change the values below to be "right", then the translation part on .genlink will not work. be mindful when trying to fix it. 310 | self.x = x 311 | self.y = y 312 | self.z = z 313 | logging.debug('set element with origin xyz:{}'.format(self.xyz)) 314 | def setrpy(self,r,p,y): 315 | self.rpy = str(r/180*PI)+' ' + str(p/180*PI)+' ' + str(y/180*PI) 316 | #TODO: this maybe not the right conversion constant!!!!!!!!!! 317 | self.r = r 318 | self.p = p 319 | self.yaw = y 320 | logging.debug('set element with origin rpy:{}'.format(self.xyz)) 321 | 322 | 323 | 324 | class SixDegree(OrVec): 325 | #TODO: need to link it to actual joint and link orvec, probably will change the class orvec and instantiate the call form the link and joint objects to have them linked 326 | #TODO: need to initialize this with actual OrVec self values and change OrVec values in the interact portion. 327 | def __init__(self): 328 | super().__init__() 329 | 330 | def setxyzrpy(self,inputs): 331 | distanceValue1Input = inputs.itemById('distanceValueX') 332 | distanceValue2Input = inputs.itemById('distanceValueY') 333 | distanceValue3Input = inputs.itemById('distanceValueZ') 334 | angleValue1Input = inputs.itemById('angleValueRoll') 335 | angleValue2Input = inputs.itemById('angleValuePitch') 336 | angleValue3Input = inputs.itemById('angleValueYaw') 337 | 338 | distanceValue1Input.value = self.x 339 | distanceValue2Input.value = self.y 340 | distanceValue3Input.value = self.z 341 | angleValue1Input.value = self.r 342 | angleValue2Input.value = self.p 343 | angleValue3Input.value = self.yaw 344 | angleValue1Input.setManipulator(adsk.core.Point3D.create(distanceValue1Input.value, distanceValue2Input.value, distanceValue3Input.value), adsk.core.Vector3D.create(0, 1, 0), adsk.core.Vector3D.create(0, 0, 1)) 345 | angleValue2Input.setManipulator(adsk.core.Point3D.create(distanceValue1Input.value, distanceValue2Input.value, distanceValue3Input.value), adsk.core.Vector3D.create(0, 0, 1), adsk.core.Vector3D.create(1, 0, 0)) 346 | angleValue3Input.setManipulator(adsk.core.Point3D.create(distanceValue1Input.value, distanceValue2Input.value, distanceValue3Input.value), adsk.core.Vector3D.create(1, 0, 0), adsk.core.Vector3D.create(0, 1, 0)) 347 | 348 | 349 | def interact(self,inputs): 350 | distanceValue1Input = inputs.itemById('distanceValueX') 351 | distanceValue2Input = inputs.itemById('distanceValueY') 352 | distanceValue3Input = inputs.itemById('distanceValueZ') 353 | angleValue1Input = inputs.itemById('angleValueRoll') 354 | angleValue2Input = inputs.itemById('angleValuePitch') 355 | angleValue3Input = inputs.itemById('angleValueYaw') 356 | 357 | self.x = distanceValue1Input.value 358 | self.y = distanceValue2Input.value 359 | self.z = distanceValue3Input.value 360 | self.r = angleValue1Input.value 361 | self.p = angleValue2Input.value 362 | self.yaw = angleValue3Input.value 363 | 364 | def jointset(self): 365 | self.isset = True 366 | 367 | def chcontrols(inputs,allvisible,allenabled): 368 | 369 | distanceValue1Input = inputs.itemById('distanceValueX') 370 | distanceValue2Input = inputs.itemById('distanceValueY') 371 | distanceValue3Input = inputs.itemById('distanceValueZ') 372 | angleValue1Input = inputs.itemById('angleValueRoll') 373 | angleValue2Input = inputs.itemById('angleValuePitch') 374 | angleValue3Input = inputs.itemById('angleValueYaw') 375 | 376 | distanceValue1Input.isVisible = allvisible 377 | distanceValue1Input.isEnabled = allenabled 378 | 379 | distanceValue2Input.isVisible = allvisible 380 | distanceValue2Input.isEnabled = allenabled 381 | 382 | distanceValue3Input.isVisible = allvisible 383 | distanceValue3Input.isEnabled = allenabled 384 | 385 | angleValue1Input.isVisible = allvisible 386 | angleValue1Input.isEnabled = allenabled 387 | 388 | angleValue2Input.isVisible = allvisible 389 | angleValue2Input.isEnabled = allenabled 390 | 391 | angleValue3Input.isVisibile = allvisible 392 | angleValue3Input.isEnabled = allenabled 393 | 394 | class Visual: 395 | def __init__(self): 396 | self.origin = OrVec() 397 | self.geometryfilename = "" 398 | self.materialname = "" 399 | self.color = '0.792156862745098 0.819607843137255 0.933333333333333 1' ### the colour that was being used in our other files. i am used to it, so i will keep it 400 | 401 | class Collision: 402 | def __init__(self): 403 | self.origin = OrVec() 404 | self.geometryfilename = "" 405 | 406 | class Link: 407 | def __init__(self,occname,row): 408 | parent = '' ### incorrect, we need to parse the fullPathName, which should be the way to instantiate this as well! 409 | #### actually, since i've changed this structure so much, now is not the time to try to set this things correctly... 410 | level = 0 411 | self.inertial = Inertial() 412 | self.visual = Visual() 413 | self.collision = Collision(); 414 | self.level = level 415 | self.name = parent+ occname; 416 | self.visual.geometryfilename = "" 417 | self.collision.geometryfilename = "" 418 | self.group = [] 419 | self.isLink = True 420 | self.row = row 421 | self.coordinatesystem = OrVec() 422 | self.isVirtual = True 423 | def __groupmembers(self,rigidgrouplist): 424 | self.group = rigidgrouplist.getgroupmemberships(self.name) 425 | return rigidgrouplist.getwholegroup(self.name) 426 | 427 | def getitems(self): 428 | items = '' 429 | for el in self.group: 430 | items = items + el.name + '\n' 431 | return items 432 | 433 | def genfatherjoint(self,joint): 434 | if not joint.isset: 435 | logging.error('tried to set displacement for link:' +self.name + ',but joint ' + joint.name + ' is not set.') 436 | ### need to set the self.coordinatesystem to contain at least the displacement from the joint. 437 | ### rotations are also probably important, but i will not do that for now. 438 | else: 439 | self.coordinatesystem = joint.origin 440 | 441 | def makexml(self, urdfroot): 442 | self.visual.geometryfilename = "package://"+_ms.packagename+"/meshes/" + clearupst(self.name) +".stl" 443 | 444 | link = etree.SubElement(urdfroot, "link", name= clearupst(self.name)) 445 | 446 | if not self.isVirtual: 447 | inertial = etree.SubElement(link, "inertial") 448 | etree.SubElement(inertial, "origin", xyz = self.inertial.origin.xyz, rpy = self.inertial.origin.rpy ) 449 | etree.SubElement(inertial, "mass", value = self.inertial.mass) 450 | etree.SubElement(inertial, "inertia", ixx= self.inertial.inertia.ixx, ixy= self.inertial.inertia.ixy, ixz= self.inertial.inertia.ixz, iyy= self.inertial.inertia.iyy, iyz= self.inertial.inertia.iyz, izz= self.inertial.inertia.izz ) 451 | 452 | visual = etree.SubElement(link, "visual") 453 | etree.SubElement(visual, "origin", xyz = self.visual.origin.xyz, rpy = self.visual.origin.rpy ) 454 | geometry = etree.SubElement(visual, "geometry") 455 | etree.SubElement(geometry, "mesh", filename = self.visual.geometryfilename) 456 | material = etree.SubElement(visual, "material", name = self.visual.materialname) 457 | etree.SubElement(material, "color", rgba = self.visual.color) 458 | 459 | collision = etree.SubElement(link, "collision") 460 | etree.SubElement(collision, "origin", xyz = self.collision.origin.xyz, rpy = self.collision.origin.rpy ) 461 | geometry = etree.SubElement(collision, "geometry") 462 | etree.SubElement(geometry, "mesh", filename = self.visual.geometryfilename) 463 | #origin = etree.SubElement(inertial, "origin") 464 | #etree.SubElement(origin, "xyz").text = self.inertial.origin.xyz 465 | #etree.SubElement(origin, "rpy").text = self.inertial.origin.rpy 466 | #### my asserts to try to avoid crashing etree 467 | assert type(self.inertial.origin.xyz) == str 468 | assert type(self.inertial.origin.rpy) == str 469 | assert type(self.inertial.mass) == str 470 | assert type(self.inertial.inertia.ixx) == str 471 | assert type(self.inertial.inertia.ixy) == str 472 | assert type(self.inertial.inertia.ixz) == str 473 | assert type(self.inertial.inertia.iyy) == str 474 | assert type(self.inertial.inertia.iyz) == str 475 | assert type(self.inertial.inertia.izz) == str 476 | assert type( self.visual.origin.xyz) == str 477 | assert type(self.visual.origin.rpy ) == str 478 | assert type( self.visual.geometryfilename) == str 479 | assert type(self.visual.materialname) == str 480 | assert type(self.visual.color) == str 481 | assert type(self.collision.origin.xyz) == str 482 | assert type(self.collision.origin.rpy) == str 483 | assert type(self.visual.geometryfilename) == str 484 | #assert type(a) == str 485 | #assert type(a) == str 486 | return urdfroot 487 | 488 | 489 | def genlink(self,meshes_directory, components_directory): 490 | didifail = 0 491 | self.isVirtual = False 492 | try: 493 | logging.debug('starting genlink') 494 | # Get the root component of the active design 495 | rootComp = _design.rootComponent 496 | 497 | # Create two new components under root component 498 | allOccs = rootComp.allOccurrences 499 | 500 | # create a single exportManager instance 501 | exportMgr = _design.exportManager 502 | 503 | ###TODO: this needs to be done for the joints as well. aff... 504 | removejointtranslation = adsk.core.Matrix3D.create() 505 | translation = adsk.core.Vector3D.create(-self.coordinatesystem.x, -self.coordinatesystem.y, -self.coordinatesystem.z) 506 | removejointtranslation.setToIdentity() 507 | removejointtranslation.translation = translation 508 | logging.debug('Offset from joint tm is:' + str( removejointtranslation.asArray())) 509 | logging.debug('Offset from joint translation is:' + str( removejointtranslation.translation.asArray())) 510 | 511 | #### add occurrances from other stuff to this new stuff 512 | for i in range(0,len(self.group)): 513 | #express = 'it'+str(i)+ '=self.group[i].transform.copy()' 514 | pathsplit = self.group[i].fullPathName.split('+') 515 | 516 | newrotl = [] 517 | for j in range(1,len(pathsplit)): 518 | thisoccnamelist = pathsplit[0:j] 519 | thisoccname = thisoccnamelist[0] 520 | for k in range(1,len(thisoccnamelist)): 521 | thisoccname = thisoccname + '+' + thisoccnamelist[k] 522 | logging.info('\tTMS::: getting the tm for:'+thisoccname) 523 | for l in range(0,allOccs.count): 524 | if allOccs.item(l).fullPathName == thisoccname: 525 | #then i want to multiply their matrices! 526 | lasttm = allOccs.item(l).transform.copy() 527 | newrotl.append(lasttm) 528 | logging.debug(allOccs.item(l).fullPathName) 529 | logging.debug('\twith tm:' + str(lasttm.asArray())) 530 | logging.debug('\twith translation is:' + str( lasttm.translation.asArray())) 531 | 532 | #newrot.transformBy(allOccs.item(l).transform) 533 | ### now that i have all the occurrences names i need to get them from allOccs(?!) 534 | lasttransform = self.group[i].transform.copy() 535 | 536 | newrotl.append(lasttransform) 537 | 538 | # newrot = removejointtranslation 539 | 540 | newrot = adsk.core.Matrix3D.create() 541 | newrot.setToIdentity() 542 | 543 | for j in reversed(range(0,len(newrotl))): 544 | newrot.transformBy(newrotl[j]) 545 | newrot.transformBy(removejointtranslation) 546 | express = 'it'+str(i)+ '=newrot' 547 | exec(express) 548 | 549 | 550 | #stlname = rootComp.name.translate(None, ':!@#$') 551 | #line = re.sub('[!@#$]', '', line) 552 | stlname = clearupst(self.name) 553 | 554 | #fileName = components_directory+'/' + stlname 555 | for i in range(0,len(self.group)): 556 | # export the root component to printer utility 557 | fileName = components_directory+'/' + stlname+str(i) 558 | logging.info('saving file '+fileName ) 559 | logging.info('from occurrence' + self.group[i].fullPathName) 560 | 561 | logging.debug('with tm:' + str(eval('it'+str(i)+'.asArray()'))) 562 | stpOptions = exportMgr.createSTEPExportOptions(fileName, self.group[i].component) 563 | exportMgr.execute(stpOptions) 564 | 565 | # Create a document. 566 | doc = _app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType) 567 | doc.name = self.name 568 | 569 | product = _app.activeProduct 570 | design = adsk.fusion.Design.cast(product) 571 | 572 | # Get the root component of the active design 573 | rootComp = design.rootComponent 574 | 575 | #### i need to divide it by 1000, actually transform it from whatever unit the original drawing was on, into SI, i.e. meters, since that is what rviz and ros use. I will do this using another transformation: 576 | # mytransf = adsk.core.Matrix3D.create() 577 | # mytransf.setToIdentity() 578 | # global thisdocsunits 579 | # if thisdocsunits == "mm": 580 | # myscaleratio = 1/1000 581 | # elif thisdocsunits == "cm": 582 | # myscaleratio = 1/100 583 | # mytransf.setCell(1,1,myscaleratio) 584 | # mytransf.setCell(2,2,myscaleratio) 585 | # mytransf.setCell(3,3,myscaleratio) 586 | ###turns out this a nonuniform transform and fusion has a check against letting you do this. i can't turn it off, or so it seems 587 | 588 | 589 | # Create two new components under root component 590 | allOccs = rootComp.occurrences 591 | 592 | # Get import manager 593 | importManager = _app.importManager 594 | 595 | #### add occurrances from other stuff to this new stuff 596 | for i in range(0,len(self.group)): 597 | fileName = components_directory+'/' + stlname+str(i)+'.stp' 598 | logging.info('loading file: '+fileName) 599 | stpOptions = importManager.createSTEPImportOptions(fileName) 600 | importManager.importToTarget(stpOptions, rootComp) 601 | for i in range(0,len(rootComp.occurrences)): 602 | thistransf = eval('it'+str(i)) 603 | ## i also want to scale them to SI units. doing it here is easier 604 | #thistransf.transformBy(removejointtranslation) 605 | rootComp.occurrences.item(i).transform = thistransf 606 | #rootComp.occurrences.item(i).transform = eval('it'+str(i)) 607 | pass 608 | 609 | ###TODO: 610 | ### must set mass and center of inertia! i think visual and origins are correct because this info is in the stl... 611 | logging.info('XYZ moments of inertia:'+str(rootComp.physicalProperties.getXYZMomentsOfInertia())) 612 | logging.info('Mass:'+str(rootComp.physicalProperties.mass)) 613 | 614 | ### setting units to meters so stls will have proper sizes! 615 | unitsMgr = design.fusionUnitsManager 616 | 617 | unitsMgr.distanceDisplayUnits = adsk.fusion.DistanceUnits.MeterDistanceUnits 618 | 619 | # create aNOTHER! exportManager instance 620 | exportMgr = design.exportManager 621 | 622 | # export the root component to printer utility 623 | stlRootOptions = exportMgr.createSTLExportOptions(rootComp, meshes_directory+'/' + stlname) 624 | 625 | # get all available print utilities 626 | #printUtils = stlRootOptions.availablePrintUtilities 627 | 628 | # export the root component to the print utility, instead of a specified file 629 | #for printUtil in printUtils: 630 | # stlRootOptions.sendToPrintUtility = True 631 | # stlRootOptions.printUtility = printUtil 632 | stlRootOptions.sendToPrintUtility = False 633 | logging.info('saving STL file: '+ meshes_directory+'/' + stlname ) 634 | exportMgr.execute(stlRootOptions) 635 | 636 | self.visual.geometryfilename = "package://"+_ms.packagename+"/meshes/" + stlname +".stl" 637 | self.collision.geometryfilename = self.visual.geometryfilename # the legend has it that this file should be a slimmer version of the visuals, so that collisions can be calculated more easily.... 638 | 639 | except: 640 | logging.debug('could not save stl. {}'.format(traceback.format_exc())) 641 | didifail = 1 642 | return didifail 643 | 644 | class Joint: 645 | # jointdefs = Joint(actualjoint, actualjointname,parentl,childl, currentLevel,parent); 646 | def __init__(self,jointname,row): 647 | level= 0 648 | self.name = jointname 649 | self.generatingjointname = '' 650 | self.origin = SixDegree() 651 | #self.origin = OrVec() 652 | 653 | self.realorigin = OrVec() 654 | self.parentlink = '' 655 | self.childlink = '' 656 | self.axis = '0 0 0' 657 | self.limit = Limit() 658 | self.level = level 659 | self.type = '' 660 | self.row = row # i am not sure why i am savign this... 661 | self.isJoint = True 662 | self.isset = False 663 | self.entity = None ## this will have the whole joint that created this joint instance. sort of dumb, but it is the way I can repopulate the selections... 664 | def setjoint(self,joint,cmdInputid,inputs):#,parentl,childl): 665 | self.isset = True 666 | self.generatingjointname = joint.name 667 | self.entity = joint ### i need this to repopulate selection, but I know it might break the code even more... 668 | 669 | ### TODO: REVIEW THIS! 670 | #self.origin.interact(cmdInputid,inputs) # this can maybe happen only if setxyz fails(?) 671 | 672 | #self.parentlink = parentl 673 | #self.childlink = childl 674 | 675 | #============================================================================== 676 | # python doesnt have a switch statement, i repeat python does not have a switch statement... 677 | # from the docs, we should implement this: 678 | # Name Value Description 679 | # BallJointType 6 Specifies a ball type of joint. 680 | # CylindricalJointType 3 Specifies a cylindrical type of joint. 681 | # PinSlotJointType 4 Specifies a pin-slot type of joint. 682 | # PlanarJointType 5 Specifies a planar type of joint. 683 | # RevoluteJointType 1 Specifies a revolute type of joint. 684 | # RigidJointType 0 Specifies a rigid type of joint. 685 | # SliderJointType 2 Specifies a slider type of joint. 686 | #============================================================================== 687 | try: 688 | self.origin.setxyz(joint.geometryOrOriginOne.origin.x, joint.geometryOrOriginOne.origin.y, joint.geometryOrOriginOne.origin.z) 689 | self.origin.setxyzrpy(inputs) 690 | except: 691 | try: 692 | self.origin.setxyz(joint.geometryOrOriginTwo.origin.x, joint.geometryOrOriginTwo.origin.y, joint.geometryOrOriginTwo.origin.z) 693 | self.origin.setxyzrpy(inputs) 694 | except: 695 | _ui.messageBox('Could not set joint origin. This will affect the whole assembly and it will be hard to fix!!! This is quite possibly a bug in the API. {}'.format(traceback.format_exc())) 696 | logging.error('Could not set joint origin. This is quite possibly a bug in the API. {}'.format(traceback.format_exc())) 697 | ### TODO so I am not using the base occurrences to set this joint - i am not using .geometryOrOriginTwo for anythin - so I might be making mistakes in prismatic joints - who uses those??? - so I should check to see if they are same and warn at least in case they are not... 698 | logging.warn('Could not set joint origins for joint: ' + self.name+'. You need to edit the URDF and fix it manually.') 699 | 700 | try: 701 | if joint.jointMotion.jointType is 1: 702 | self.type = "revolute" 703 | self.axis = str(joint.jointMotion.rotationAxisVector.x)+ ' ' + str(joint.jointMotion.rotationAxisVector.y)+ ' ' + str(joint.jointMotion.rotationAxisVector.z) 704 | if joint.jointMotion.jointType is 0: 705 | self.type = "fixed" 706 | 707 | haslimits = False 708 | if 'rotationLimits' in dir(joint.jointMotion): 709 | if joint.jointMotion.rotationLimits.isMinimumValueEnabled: 710 | self.limit.lower = str(joint.jointMotion.rotationLimits.minimumValue) 711 | haslimits = True 712 | if joint.jointMotion.rotationLimits.isMaximumValueEnabled: 713 | self.limit.upper = str(joint.jointMotion.rotationLimits.maximumValue) 714 | haslimits = True 715 | if self.type == "revolute" and not haslimits: 716 | self.type = "continuous" 717 | except: 718 | self.type = "fixed" ## i still want to produce some sort of URDF. hopefully this will be a bad one, but recoverable by changing offsets and joint type/angles 719 | logging.debug('could not set joint type or limits. Setting it to fixed. This is quite possibly a bug in the API. {}'.format(traceback.format_exc())) 720 | _ui.messageBox('could not set joint type or limits. Setting it to fixed. This is quite possibly a bug in the API. {}'.format(traceback.format_exc())) 721 | logging.warn('Could not set joint type for joint' + self.name+'. You need to edit the URDF and fix it manually.') 722 | 723 | def setrealorigin(self, fathercoordinatesystem): 724 | assert fathercoordinatesystem.isset 725 | logging.debug('setting real origins') 726 | self.realorigin.setxyz(self.origin.x- fathercoordinatesystem.x, self.origin.y - fathercoordinatesystem.y, self.origin.z- fathercoordinatesystem.z) 727 | 728 | def getitems(self): 729 | items = 'genjn:'+self.generatingjointname+'\n'+'parent:' + self.parentlink + '\t' + 'child:' + self.childlink 730 | return items 731 | 732 | def makexml(self, urdfroot): 733 | 734 | joint = etree.SubElement(urdfroot, "joint", name= clearupst(self.name), type = self.type) 735 | etree.SubElement(joint, "origin", xyz = self.realorigin.xyz, rpy = self.realorigin.rpy) 736 | etree.SubElement(joint, "parent", link = self.parentlink) 737 | etree.SubElement(joint, "child", link = self.childlink) 738 | etree.SubElement(joint, "axis", xyz = self.axis) 739 | etree.SubElement(joint, "limit", lower = self.limit.lower, upper = self.limit.upper, effort=self.limit.effort, velocity = self.limit.velocity) 740 | #origin = etree.SubElement(inertial, "origin") 741 | #etree.SubElement(origin, "xyz").text = self.inertial.origin.xyz 742 | #etree.SubElement(origin, "rpy").text = self.inertial.origin.rpy 743 | ###my asserts checks now, because this code is driving me insane 744 | assert type(self.type) == str 745 | assert type(self.realorigin.xyz) == str 746 | assert type(self.realorigin.rpy) == str 747 | assert type(self.parentlink) == str 748 | assert type(self.childlink) == str 749 | assert type(self.axis) == str 750 | assert type(self.limit.lower) == str 751 | assert type(self.limit.upper) == str 752 | assert type(self.limit.effort) == str 753 | assert type( self.limit.velocity) == str 754 | 755 | return urdfroot 756 | 757 | class Limit: 758 | def __init__(self): 759 | self.lower = '-1' 760 | self.upper = '1' 761 | self.effort = '0' 762 | self.velocity = '0' 763 | 764 | def superprint(level,stringo): 765 | #logger = logging.getLogger(__name__) 766 | #logger.debug(spaces(level*5)+stringo) 767 | logging.debug(spaces(level*5)+stringo) 768 | 769 | 770 | def clearupst(stringo): 771 | strstr1 = re.sub('[:!@#$.()/-]', '',stringo) 772 | strstr2 = re.sub(' ', '_',strstr1) 773 | return strstr2 774 | 775 | # Returns a string containing the especified number of spaces. 776 | def spaces(spaceCount): 777 | result = '' 778 | for i in range(0, spaceCount): 779 | result += ' ' 780 | 781 | return result 782 | 783 | 784 | # Adds a new row to the table. 785 | def addRowToTable(tableInput,LinkOrJoint): 786 | global _ms 787 | # Get the CommandInputs object associated with the parent command. 788 | cmdInputs = adsk.core.CommandInputs.cast(tableInput.commandInputs) 789 | 790 | if LinkOrJoint =='' or LinkOrJoint == 'Link': 791 | dropdownthingy = True 792 | _ms.numoflinks += 1 793 | elif LinkOrJoint =='Joint': 794 | dropdownthingy = False 795 | _ms.numofjoints += 1 796 | 797 | # Create three new command inputs. 798 | #valueInput = cmdInputs.addTextBoxCommandInput('TableInput_value{}'.format(_ms.elnum ), 'JorL', 'Link',1,True) 799 | JorLInput = cmdInputs.addDropDownCommandInput('TableInput_value{}'.format(_ms.elnum ), 'JorLTable{}'.format(_ms.elnum ), adsk.core.DropDownStyles.TextListDropDownStyle) 800 | dropdownItems = JorLInput.listItems 801 | dropdownItems.add('Link', dropdownthingy, '') 802 | dropdownItems.add('Joint', not dropdownthingy,'') 803 | if _ms.elnum == 0: 804 | rightlinkname = 'base' 805 | elif LinkOrJoint =='' or LinkOrJoint == 'Link': 806 | rightlinkname = 'link' +str(_ms.numoflinks) # str(_ms.elnum ) 807 | elif LinkOrJoint =='Joint': 808 | rightlinkname = 'joint' + str(_ms.numofjoints)# str(_ms.elnum ) 809 | 810 | stringInput = cmdInputs.addStringValueInput('TableInput_string{}'.format(_ms.elnum ), 'StringTable{}'.format(_ms.elnum ), rightlinkname) 811 | elnnumInput = cmdInputs.addStringValueInput('elnum{}'.format(_ms.elnum ), 'elnumTable{}'.format(_ms.elnum ), str(_ms.elnum )) 812 | #spinnerInput = cmdInputs.addIntegerSpinnerCommandInput('spinnerInt{}'.format(_ms.elnum ), 'Integer Spinner', 0 , 100 , 2, int(_ms.elnum )) 813 | slbutInput = cmdInputs.addBoolValueInput('butselectClick{}'.format(_ms.elnum ),'Select', False,'', True) 814 | 815 | 816 | 817 | elnnumInput.isEnabled = False 818 | stringInput.isEnabled = False ##### i~m disabling the ability to change element~s name randomly... 819 | # Add the inputs to the table. 820 | row = tableInput.rowCount 821 | ha0 = tableInput.addCommandInput( elnnumInput, row, 0) 822 | ha1 = tableInput.addCommandInput(JorLInput, row, 1) 823 | #tableInput.addCommandInput(valueInput, row, 0) 824 | ha2 = tableInput.addCommandInput(stringInput, row, 2) 825 | #tableInput.addCommandInput(spinnerInput, row, 2) 826 | ha3 = tableInput.addCommandInput(slbutInput, row, 3) 827 | 828 | print(ha0) 829 | print(ha1) 830 | print(ha2) 831 | print(ha3) 832 | 833 | # Increment a counter used to make each row unique. 834 | 835 | _ms.rowNumber = _ms.rowNumber + 1 836 | _ms.elnum += 1 837 | 838 | 839 | # Event handler that reacts to any changes the user makes to any of the command inputs. 840 | class AddLinkCommandInputChangedHandler(adsk.core.InputChangedEventHandler): 841 | def __init__(self): 842 | super().__init__() 843 | def notify(self, args): 844 | try: 845 | global _ms 846 | 847 | eventArgs = adsk.core.InputChangedEventArgs.cast(args) 848 | inputs = eventArgs.inputs 849 | cmdInput = eventArgs.input 850 | 851 | #linkInput = inputs.itemById('linkname') 852 | JorLNameInput = inputs.itemById('StringTable') 853 | 854 | tableInput = inputs.itemById('table') 855 | debugInput = inputs.itemById('debugbox') 856 | linkgroupInput = inputs.itemById('linkgroup') 857 | jointgroupInput = inputs.itemById('jointgroup') 858 | 859 | if linkgroupInput is None: ###inside the group, there is no group! 860 | linkselInput = inputs.itemById('linkselection') 861 | else: 862 | linkselInput = linkgroupInput.children.itemById('linkselection') 863 | 864 | if jointgroupInput is None: ###inside the group, there is no group! 865 | jointselInput = inputs.itemById('jointselection') 866 | else: 867 | jointselInput = jointgroupInput.children.itemById('jointselection') 868 | 869 | # if _ms.thistree.currentel is not None: 870 | # _ms.oldrow = _ms.thistree.currentel.row 871 | # else: 872 | # _ms.oldrow = -1 873 | 874 | 875 | 876 | if tableInput is not None: 877 | ################################################################ 878 | # set current link 879 | ### if working in table contextÇ otherwise we do not want to change it. 880 | if tableInput.selectedRow == -1: 881 | ### it means we have nothing selecte, so we don~t want to change anything 882 | pass 883 | else: 884 | elementtobedefined = tableInput.getInputAtPosition(tableInput.selectedRow,0).value 885 | setcurrel(elementtobedefined,debugInput, _ms.oldrow, linkselInput, jointselInput) 886 | 887 | # crnum = getrow('TableInput_value', cmdInput.id, tableInput.selectedRow,debugInput) 888 | # if crnum and tableInput.selectedRow != -1 and tableInput.getInputAtPosition(tableInput.selectedRow,1).selectedItem.name == 'Joint' and tableInput.getInputAtPosition(tableInput.selectedRow,1).isEnabled: 889 | # tableInput.getInputAtPosition(tableInput.selectedRow,2).value = 'joint'+crnum 890 | 891 | #JorLTableInput 892 | ### if it is different from what it was before, then i should change the name, right? 893 | #_ui.messageBox('changedstuff! in row' + rowrow) 894 | crnum = getrow('butselectClick', cmdInput.id, tableInput,debugInput) 895 | if crnum: 896 | if tableInput.selectedRow == -1: 897 | ### it means we have nothing selected, so we don~t want to change anything 898 | pass 899 | else: 900 | elementtobedefined = tableInput.getInputAtPosition(tableInput.selectedRow,0).value 901 | setcurrel(elementtobedefined,debugInput, _ms.oldrow, linkselInput, jointselInput) 902 | #### it was getting complicated for me to debug this, so i am simpliflying the UI. i will only be able to change the name of the selected link. that's it. 903 | #### i know clicking it changes the row - this doesn~t happen so nicely with the string, so i will use this 904 | tableInput.getInputAtPosition(tableInput.selectedRow,2).isEnabled = True 905 | if _ms.oldrow != -1 and _ms.oldrow != tableInput.selectedRow: 906 | tableInput.getInputAtPosition(_ms.oldrow,2).isEnabled = False 907 | 908 | # if cmdInput.id == 'tableCreate' and tableInput.getInputAtPosition(tableInput.selectedRow,1).isEnabled: 909 | # 910 | # tableInput.getInputAtPosition(tableInput.selectedRow,1).isEnabled = False 911 | # ### and create stuff!!! 912 | # if tableInput.getInputAtPosition(tableInput.selectedRow,1).selectedItem.name == 'Link': 913 | # linkname = tableInput.getInputAtPosition(tableInput.selectedRow,2).value 914 | # logging.debug('adding link:' + str(linkname)) 915 | # _ms.thistree.addLink(linkname,tableInput.selectedRow) 916 | # setcurrel(tableInput.selectedRow,debugInput, oldrow, linkselInput, jointselInput) 917 | # elif tableInput.getInputAtPosition(tableInput.selectedRow,1).selectedItem.name == 'Joint': 918 | # jointname = tableInput.getInputAtPosition(tableInput.selectedRow,2).value 919 | # logging.debug('adding joint:' + str(jointname)) 920 | # _ms.thistree.addJoint(jointname,tableInput.selectedRow) 921 | # setcurrel(tableInput.selectedRow,debugInput, oldrow, linkselInput, jointselInput) 922 | 923 | crnum = getrow('TableInput_string', cmdInput.id, tableInput,debugInput) 924 | if crnum: 925 | ####should change the name of the current element here 926 | 927 | if tableInput.selectedRow == -1: 928 | ### it means we have nothing selecte, so we don~t want to change anything 929 | pass 930 | else: 931 | _ms.thistree.currentel.name = tableInput.getInputAtPosition(tableInput.selectedRow,2).value 932 | elementtobedefined = tableInput.getInputAtPosition(tableInput.selectedRow,0).value 933 | setcurrel(elementtobedefined,debugInput, _ms.oldrow, linkselInput, jointselInput) 934 | 935 | 936 | if cmdInput.id == 'packagename': 937 | pkgnInput = inputs.itemById('packagename') 938 | _ms.packagename = pkgnInput.value 939 | 940 | if cmdInput.id == 'tableJointAdd': 941 | addRowToTable(tableInput,'Joint') 942 | tableInput.getInputAtPosition(_ms.rowNumber-1,1).isEnabled = False 943 | ####horrible hack because it is lateand i am tired of this thing. 944 | logging.debug('adding joint. row number'+str(_ms.rowNumber)) 945 | jointname = tableInput.getInputAtPosition(_ms.rowNumber-1,2).value 946 | logging.debug('adding joint:' + str(jointname)) 947 | _ms.thistree.addJoint(jointname,_ms.elnum -1) 948 | #_ms.thistree.addJoint(jointname,_ms.elnum -1,inputs) 949 | #setcurrel(tableInput.getInputAtPosition(tableInput.selectedRow,0).value,debugInput, oldrow, linkselInput, jointselInput) 950 | 951 | if cmdInput.id == 'tableLinkAdd': 952 | addRowToTable(tableInput,'Link') 953 | tableInput.getInputAtPosition(_ms.rowNumber-1,1).isEnabled = False 954 | logging.debug('adding link. row number'+str(_ms.rowNumber)) 955 | linkname = tableInput.getInputAtPosition(_ms.rowNumber-1,2).value 956 | logging.debug('adding link:' + str(linkname)) 957 | _ms.thistree.addLink(linkname,_ms.elnum -1) 958 | #setcurrel(tableInput.getInputAtPosition(tableInput.selectedRow,0).value,debugInput, oldrow, linkselInput, jointselInput) 959 | 960 | if cmdInput.id == 'tableAdd': 961 | addRowToTable(tableInput,'') 962 | elif cmdInput.id == 'tableDelete': 963 | if tableInput.selectedRow == -1: 964 | _ui.messageBox('Select one row to delete.') 965 | else: 966 | ###this only works if every element is created as well... 967 | logging.debug('trying to delete element from row:' + str(tableInput.selectedRow) + ' supposedly index:' + tableInput.getInputAtPosition(tableInput.selectedRow,0).value) 968 | elementnumbertoremove = tableInput.getInputAtPosition(tableInput.selectedRow,0).value 969 | _ms.thistree.rmElement(elementnumbertoremove) 970 | tableInput.deleteRow(tableInput.selectedRow) 971 | 972 | ### setting up visibility of joint and link group selection stufffs: 973 | if tableInput.selectedRow!= -1 and not tableInput.getInputAtPosition(tableInput.selectedRow,1).isEnabled and tableInput.getInputAtPosition(tableInput.selectedRow,1).selectedItem.name == 'Link': 974 | 975 | linkgroupInput.isVisible = True 976 | jointgroupInput.isVisible = False 977 | chcontrols(jointgroupInput.children,True,False) 978 | if tableInput.selectedRow!= -1 and not tableInput.getInputAtPosition(tableInput.selectedRow,1).isEnabled and tableInput.getInputAtPosition(tableInput.selectedRow,1).selectedItem.name == 'Joint': 979 | 980 | linkgroupInput.isVisible = False 981 | jointgroupInput.isVisible = True 982 | 983 | chcontrols(jointgroupInput.children,True,True) 984 | # 985 | assert _ms.thistree.currentel.isJoint 986 | _ms.thistree.currentel.origin.setxyzrpy(jointgroupInput.children) 987 | 988 | pln = jointgroupInput.children.itemById('parentlinkname') 989 | cln = jointgroupInput.children.itemById('childlinkname') 990 | alllinkstr, _ = _ms.thistree.allLinks() 991 | alllinkgr = alllinkstr.split('\n') 992 | pln.listItems.clear() 993 | cln.listItems.clear() 994 | for link in alllinkgr: 995 | pln.listItems.add(link, False,'') 996 | cln.listItems.add(link, False,'') 997 | 998 | if cmdInput.id == 'linkselection': 999 | #### wait, i think i can export a selection! so... 1000 | #### so, if I try to select things without having set anything, it jumps here into linkselection. I don't want this to happen, so i will make it create a ballon to warn it 1001 | if 'group' not in dir(_ms.thistree.currentel): 1002 | _ui.messageBox('Must create link or joint before selecting!') 1003 | return 1004 | _ms.thistree.currentel.group = [] #### i refer to element, but i know it is a link! 1005 | for i in range(0, linkselInput.selectionCount): 1006 | if linkselInput.selection(i).entity not in _ms.thistree.currentel.group: 1007 | logging.debug('adding link entity:'+ linkselInput.selection(i).entity.name) 1008 | _ms.thistree.currentel.group.append( linkselInput.selection(i).entity) 1009 | if "PRT" in linkselInput.selection(i).entity.name: 1010 | pass 1011 | ##TODO: 1012 | # REMOVE child occurrences that can be in the list, or they will be doubled in generating the link -> larger mesh, wrong weight and moments of inertia 1013 | #logging.debug(dir(linkselInput.selection(i).entity)) 1014 | if cmdInput.id == 'parentlinkname': 1015 | pln = inputs.itemById('parentlinkname') 1016 | aa= pln.selectedItem.name.split('link: ') 1017 | _ms.thistree.currentel.parentlink = aa[1] 1018 | 1019 | if cmdInput.id == 'childlinkname': 1020 | cln = inputs.itemById('childlinkname') 1021 | aa= cln.selectedItem.name.split('link: ') 1022 | _ms.thistree.currentel.childlink = aa[1] 1023 | 1024 | if cmdInput.id == 'jointselection' and jointselInput.selectionCount == 1: 1025 | logging.debug('adding joint entity:'+ jointselInput.selection(0).entity.name) 1026 | _ms.thistree.currentel.setjoint( jointselInput.selection(0).entity,cmdInput.id,inputs) 1027 | 1028 | if cmdInput.id == 'createtree': 1029 | #linkselInput.hasFocus = True #### if this is not set, then you cannot click OK idk why... 1030 | ### actually it is worse. if you don~t have a selection from the selection thing as active, it will not let you execute it. 1031 | ### so horrible not realy a fix: 1032 | linkgroupInput.isVisible = False 1033 | jointgroupInput.isVisible = False 1034 | chcontrols(jointgroupInput.children,False,False) 1035 | _ms.thistree.gentree() 1036 | if linkselInput.selectionCount == 0 and jointselInput.selectionCount == 0: 1037 | _ui.messageBox("one last thing: if you leave both joint and link selections without any thing select, fusion will believe it does not need to execute the command - so the OK will be grayed out. Moreover, if it either of them have focus, but don't have anything selected, it will show the OK button, but it will not execute anything. i currently don't know how to fix this without either saving the selection and repopulating them each time the user clicks on the select button- maybe a nice feature, but something that will take me some time to do, or adding subcommands to do those selections - something I am not sure if it is possible (it should be), but also will take me some time to get around doing. \n easiest way to fix this is go to a joint and reselect it, then run OK") 1038 | 1039 | ###### joint control 1040 | distanceValue1Input = inputs.itemById('distanceValueX') 1041 | distanceValue2Input = inputs.itemById('distanceValueY') 1042 | distanceValue3Input = inputs.itemById('distanceValueZ') 1043 | 1044 | angleValue1Input = inputs.itemById('angleValueRoll') 1045 | angleValue2Input = inputs.itemById('angleValuePitch') 1046 | angleValue3Input = inputs.itemById('angleValueYaw') 1047 | 1048 | 1049 | if cmdInput.id == 'distanceValueY': 1050 | distanceValue3Input.setManipulator(adsk.core.Point3D.create(distanceValue1Input.value, distanceValue2Input.value, 0), adsk.core.Vector3D.create(0, 0, 1)) 1051 | #distanceValue3Input.manipulatorOrigin.y = distanceValue2Input.value 1052 | 1053 | if cmdInput.id == 'distanceValueZ': 1054 | #distanceValue2Input.setManipulator(adsk.core.Point3D.create(0, 0, 0), adsk.core.Vector3D.create(0, 1, 0)) 1055 | pass 1056 | if cmdInput.id == 'distanceValueX': 1057 | #distanceValue2Input.setManipulator(adsk.core.Point3D.create(0, 0, 0), adsk.core.Vector3D.create(0, 1, 0)) 1058 | distanceValue2Input.setManipulator(adsk.core.Point3D.create(distanceValue1Input.value, 0, 0), adsk.core.Vector3D.create(0, 1, 0)) 1059 | distanceValue3Input.setManipulator(adsk.core.Point3D.create(distanceValue1Input.value, distanceValue2Input.value, 0), adsk.core.Vector3D.create(0, 0, 1)) 1060 | 1061 | 1062 | if cmdInput.id in ['distanceValueX','distanceValueY','distanceValueZ']: 1063 | 1064 | angleValue1Input.setManipulator(adsk.core.Point3D.create(distanceValue1Input.value, distanceValue2Input.value, distanceValue3Input.value), adsk.core.Vector3D.create(0, 1, 0), adsk.core.Vector3D.create(0, 0, 1)) 1065 | angleValue2Input.setManipulator(adsk.core.Point3D.create(distanceValue1Input.value, distanceValue2Input.value, distanceValue3Input.value), adsk.core.Vector3D.create(0, 0, 1), adsk.core.Vector3D.create(1, 0, 0)) 1066 | angleValue3Input.setManipulator(adsk.core.Point3D.create(distanceValue1Input.value, distanceValue2Input.value, distanceValue3Input.value), adsk.core.Vector3D.create(1, 0, 0), adsk.core.Vector3D.create(0, 1, 0)) 1067 | 1068 | if cmdInput.id in ['distanceValueX','distanceValueY','distanceValueZ','angleValueRoll','angleValuePitch','angleValueYaw']: 1069 | assert _ms.thistree.currentel.isJoint 1070 | _ms.thistree.currentel.origin.interact(inputs) 1071 | #pass 1072 | 1073 | if cmdInput.id == 'setjoint': 1074 | assert _ms.thistree.currentel.isJoint 1075 | _ms.thistree.currentel.origin.jointset() 1076 | 1077 | if tableInput is not None: 1078 | _ms.oldrow = tableInput.selectedRow 1079 | except: 1080 | _ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 1081 | 1082 | 1083 | def setcurrel(tbsr,dbi, oldrow, linkselInput, jointselInput): 1084 | global _ms 1085 | _ms.thistree.setcurrentel(int(tbsr)) 1086 | if _ms.thistree.currentel is not None: 1087 | row = _ms.thistree.currentel.row 1088 | if row != oldrow: 1089 | linkselInput.clearSelection() 1090 | jointselInput.clearSelection() 1091 | #### So I also want to change the current selection so that people can see what they did: 1092 | if 'isLink' in dir(_ms.thistree.currentel) and _ms.thistree.currentel.isLink: #link is selected 1093 | #pass 1094 | # linkselInput.addSelection 1095 | for i in range(0, len(_ms.thistree.currentel.group)): 1096 | linkselInput.addSelection(_ms.thistree.currentel.group[i]) 1097 | elif 'isJoint' in dir(_ms.thistree.currentel) and _ms.thistree.currentel.isJoint: #joint is selected 1098 | #pass 1099 | # jointselInput 1100 | if _ms.thistree.currentel.entity: 1101 | jointselInput.addSelection(_ms.thistree.currentel.entity) 1102 | else: 1103 | row = oldrow 1104 | alllinkstr, _ = _ms.thistree.allElements() 1105 | #dbi.text =str(oldrow)+'\t'+str(row)+'\n'+'current element: '+ _ms.thistree.getcurrenteldesc() + '\n' + alllinkstr 1106 | dbi.text ='current element: '+ _ms.thistree.getcurrenteldesc() + '\n' + alllinkstr 1107 | 1108 | 1109 | def getrow(commandstr,cmdid, tableInput, debugInput): 1110 | if tableInput.selectedRow == -1: 1111 | ### it means we have nothing selecte, so we don~t want to change anything 1112 | pass 1113 | else: 1114 | elementtobedefined = tableInput.getInputAtPosition(tableInput.selectedRow,0).value 1115 | if commandstr in cmdid: 1116 | _, crnum = cmdid.split(commandstr) 1117 | #_ms.thistree.setcurrentlink(tbsr) 1118 | #print('this when accessing table row' + crnum + str(tbsr)) 1119 | # logging.debug('this when accessing table row' + crnum + str(tbsr)) 1120 | 1121 | return crnum 1122 | else: 1123 | return False 1124 | 1125 | # Event handler that reacts to when the command is destroyed. This terminates the script. 1126 | class AddLinkCommandDestroyHandler(adsk.core.CommandEventHandler): 1127 | def __init__(self): 1128 | super().__init__() 1129 | def notify(self, args): 1130 | try: 1131 | global _ms 1132 | logging.info("shutting down.") 1133 | # When the command is done, terminate the script 1134 | # This will release all globals which will remove all event handlers 1135 | for handler in logging.root.handlers[:]: 1136 | handler.close() 1137 | if not runfrommenu: 1138 | logging.root.removeHandler(handler) 1139 | global _ms 1140 | del(_ms) 1141 | _ms = [] 1142 | if runfrommenu: 1143 | pass 1144 | #adsk.terminate() 1145 | except: 1146 | _ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 1147 | 1148 | 1149 | class AddLinkCommandExecuteHandler(adsk.core.CommandEventHandler): 1150 | def __init__(self): 1151 | super().__init__() 1152 | def notify(self, args): 1153 | try: 1154 | global _ms 1155 | logging.debug('started execute! ') 1156 | 1157 | #eventArgs = adsk.core.CommandEventArgs.cast(args) 1158 | #inputs = eventArgs.inputs 1159 | #cmdInput = eventArgs.input 1160 | 1161 | base_directory, meshes_directory, components_directory = createpaths(_ms.packagename) 1162 | 1163 | urdfroot = etree.Element("robot", name = "gummi") 1164 | 1165 | base_link = Link('base_link',-1) 1166 | base_link.makexml(urdfroot) 1167 | # 1168 | setaxisjoint = Joint('set_worldaxis',-1) 1169 | setaxisjoint.isset = True 1170 | setaxisjoint.type = "fixed" 1171 | setaxisjoint.realorigin.rpy = str(PI/2)+' 0 0' 1172 | setaxisjoint.parentlink = 'base_link' 1173 | setaxisjoint.childlink = 'base' 1174 | setaxisjoint.makexml(urdfroot) 1175 | 1176 | # _ms.thistree.currentlink.genlink(meshes_directory) 1177 | # #currentlink.name = linkInput.value 1178 | # _ms.thistree.currentlink.makelinkxml(urdfroot) 1179 | allelstr, allels = _ms.thistree.allElements() 1180 | logging.info('found '+ str(len(allels)) +'elements.\n'+ allelstr) 1181 | 1182 | for i in range(0,len(allels)): 1183 | if 'isLink' in dir(allels[i]) and allels[i].isLink: 1184 | logging.info(bigprint('calling genlink for link:{}'.format(allels[i].name))) 1185 | allels[i].genlink(meshes_directory, components_directory) 1186 | #currentlink.name = linkInput.value 1187 | allels[i].makexml(urdfroot) 1188 | 1189 | tree = etree.ElementTree(urdfroot) 1190 | root = tree.getroot() 1191 | treestring = etree.tostring(root) 1192 | #treestring = str(root) 1193 | 1194 | #ui.messageBox(treestring) 1195 | xmldomtype = xml.dom.minidom.parseString(treestring) 1196 | pretty_xml_as_string = xmldomtype.toprettyxml() 1197 | #prettytree = etree(); 1198 | #prettytree = etree.fromstring(pretty_xml_as_string) 1199 | #prettytree.write("c:/test/robot.urdf") 1200 | 1201 | 1202 | 1203 | with open(base_directory +"/robot.urdf", "w") as text_file: 1204 | print(pretty_xml_as_string, file=text_file) 1205 | 1206 | # Code to react to the event. 1207 | #_ui.messageBox('In MyExecuteHandler event handler.') 1208 | except: 1209 | logging.error('Failed:\n{}'.format(traceback.format_exc())) 1210 | _ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 1211 | 1212 | def bigprint(string): 1213 | return '\n==============================\n {}\n==============================\n'.format(string) 1214 | 1215 | # Event handler that reacts when the command definitio is executed which 1216 | # results in the command being created and this event being fired. 1217 | class AddLinkCommandCreatedHandler(adsk.core.CommandCreatedEventHandler): 1218 | def __init__(self): 1219 | super().__init__() 1220 | def notify(self, args): 1221 | try: 1222 | 1223 | global _ms, _design 1224 | _app = adsk.core.Application.get() 1225 | #_ui = _app.userInterface 1226 | product = _app.activeProduct 1227 | _design = adsk.fusion.Design.cast(product) 1228 | 1229 | logging.info(bigprint('Starting GUI')) 1230 | _ms = MotherShip() 1231 | # Get the command that was created. 1232 | cmd = adsk.core.Command.cast(args.command) 1233 | 1234 | # Connect to the command destroyed event. 1235 | onDestroy = AddLinkCommandDestroyHandler() 1236 | cmd.destroy.add(onDestroy) 1237 | _handlers.append(onDestroy) 1238 | 1239 | # Connect to the input changed event. 1240 | onInputChanged = AddLinkCommandInputChangedHandler() 1241 | cmd.inputChanged.add(onInputChanged) 1242 | _handlers.append(onInputChanged) 1243 | 1244 | onExecute = AddLinkCommandExecuteHandler() 1245 | cmd.execute.add(onExecute) 1246 | _handlers.append(onExecute) 1247 | 1248 | # Get the CommandInputs collection associated with the command. 1249 | inputs = cmd.commandInputs 1250 | 1251 | 1252 | # Create a tab input. 1253 | tabCmdInput3 = inputs.addTabCommandInput('tab_1', 'Add Link') 1254 | tab3ChildInputs = tabCmdInput3.children 1255 | 1256 | tab3ChildInputs.addStringValueInput('packagename','Name of your URDF package', _ms.packagename) 1257 | #tab3ChildInputs.addStringValueInput('packagename','Name of your URDF package', 'mypackage') 1258 | ### TODO: needs to be set up with _ms.packagename when _ms is created! 1259 | 1260 | # Create table input 1261 | tableInput = tab3ChildInputs.addTableCommandInput('table', 'Table', 3, '1:2:3:1') 1262 | 1263 | tableInput.maximumVisibleRows = 20 1264 | tableInput.minimumVisibleRows = 10 1265 | # addRowToTable(tableInput,'Link') 1266 | # 1267 | # tableInput.getInputAtPosition(_ms.rowNumber-1,1).isEnabled = False 1268 | # logging.debug('adding link. row number'+str(_ms.rowNumber)) 1269 | # linkname = tableInput.getInputAtPosition(_ms.rowNumber-1,2).value 1270 | # logging.debug('adding link:' + str(linkname)) 1271 | # _ms.thistree.addLink(linkname,_ms.rowNumber-1) 1272 | 1273 | 1274 | # Add inputs into the table. 1275 | #addButtonInput = tab3ChildInputs.addBoolValueInput('tableAdd', 'Add', False, '', True) 1276 | #tableInput.addToolbarCommandInput(addButtonInput) 1277 | #### im removing add and create because of reasons. 1278 | addLinkButtonInput = tab3ChildInputs.addBoolValueInput('tableLinkAdd', 'Add Link', False, '', True) 1279 | tableInput.addToolbarCommandInput(addLinkButtonInput) 1280 | addJointButtonInput = tab3ChildInputs.addBoolValueInput('tableJointAdd', 'Add joint', False, '', True) 1281 | tableInput.addToolbarCommandInput(addJointButtonInput) 1282 | 1283 | deleteButtonInput = tab3ChildInputs.addBoolValueInput('tableDelete', 'Delete', False, '', True) 1284 | tableInput.addToolbarCommandInput(deleteButtonInput) 1285 | #createButtonInput = tab3ChildInputs.addBoolValueInput('tableCreate', 'Create', False, '', True) 1286 | #tableInput.addToolbarCommandInput(createButtonInput) 1287 | 1288 | # Create a read only textbox input. 1289 | #tab1ChildInputs.addTextBoxCommandInput('readonly_textBox', 'URDF TREE', 'this would be the tree', 10, True) 1290 | 1291 | 1292 | # Create a message that spans the entire width of the dialog by leaving out the "name" argument. 1293 | #message = '
For more information on how to create an URDF, visit our website.
' 1294 | #tab3ChildInputs.addTextBoxCommandInput('fullWidth_textBox', '', message, 1, True) 1295 | 1296 | ##create thing that shows tree of links and joints 1297 | tab3ChildInputs.addBoolValueInput('createtree','Create tree', False,'', True) 1298 | 1299 | # Create a message that spans the entire width of the dialog by leaving out the "name" argument. 1300 | messaged = '' 1301 | tab3ChildInputs.addTextBoxCommandInput('debugbox', '', messaged, 10, True) 1302 | 1303 | # add group for link stuff 1304 | mylinkgroup = tab3ChildInputs.addGroupCommandInput('linkgroup', 'Link stuff' ) 1305 | mylinkgroup.isVisible = False 1306 | 1307 | # Create a selection input. 1308 | selectionInput1 = mylinkgroup.children.addSelectionInput('linkselection', 'Select Link Components', 'Basic select command input') 1309 | selectionInput1.addSelectionFilter('Occurrences') 1310 | selectionInput1.setSelectionLimits(0) 1311 | 1312 | # add group for link stuff 1313 | myjointgroup = tab3ChildInputs.addGroupCommandInput('jointgroup', 'Joint stuff' ) 1314 | myjointgroup.isVisible = False 1315 | 1316 | #global jtctrl 1317 | jtctrl = myjointgroup.children 1318 | allvisible = True 1319 | allenabled = False 1320 | 1321 | jtctrl.addBoolValueInput('setjoint','Set Joint', False,'', True) 1322 | 1323 | distanceValueInput = jtctrl.addDistanceValueCommandInput('distanceValueX', 'X', adsk.core.ValueInput.createByReal(0))#self.x+epsilon)) 1324 | distanceValueInput.setManipulator(adsk.core.Point3D.create(0, 0, 0), adsk.core.Vector3D.create(1, 0, 0)) 1325 | #return 1326 | distanceValueInput.hasMinimumValue = False 1327 | distanceValueInput.hasMaximumValue = False 1328 | distanceValueInput.isVisible = allvisible 1329 | distanceValueInput.isEnabled = allenabled 1330 | 1331 | # Create distance value input 2. 1332 | distanceValueInput2 = jtctrl.addDistanceValueCommandInput('distanceValueY', 'Y', adsk.core.ValueInput.createByReal(0))#self.y+epsilon)) 1333 | distanceValueInput2.setManipulator(adsk.core.Point3D.create(0, 0, 0), adsk.core.Vector3D.create(0, 1, 0)) 1334 | distanceValueInput2.hasMinimumValue = False 1335 | distanceValueInput2.hasMaximumValue = False 1336 | distanceValueInput2.isVisible = allvisible 1337 | distanceValueInput2.isEnabled = allenabled 1338 | 1339 | # Create distance value input 3. 1340 | distanceValueInput3 = jtctrl.addDistanceValueCommandInput('distanceValueZ', 'Z', adsk.core.ValueInput.createByReal(0))#self.z+epsilon)) 1341 | distanceValueInput3.setManipulator(adsk.core.Point3D.create(0, 0, 0), adsk.core.Vector3D.create(0, 0, 1)) 1342 | distanceValueInput3.hasMinimumValue = False 1343 | distanceValueInput3.hasMaximumValue = False 1344 | distanceValueInput3.isVisible = allvisible 1345 | distanceValueInput3.isEnabled = allenabled 1346 | 1347 | # Create angle value input 1. 1348 | angleValueInput = jtctrl.addAngleValueCommandInput('angleValueRoll', 'Roll', adsk.core.ValueInput.createByReal(0))#self.r+epsilon)) 1349 | angleValueInput.setManipulator(adsk.core.Point3D.create(0, 0, 0), adsk.core.Vector3D.create(0, 1, 0), adsk.core.Vector3D.create(0, 0, 1)) 1350 | angleValueInput.hasMinimumValue = False 1351 | angleValueInput.hasMaximumValue = False 1352 | angleValueInput.isVisible = allvisible 1353 | angleValueInput.isEnabled = allenabled 1354 | 1355 | # Create angle value input 2. 1356 | angleValueInput2 = jtctrl.addAngleValueCommandInput('angleValuePitch', 'Pitch', adsk.core.ValueInput.createByReal(0))#self.p+epsilon)) 1357 | angleValueInput2.setManipulator(adsk.core.Point3D.create(0, 0, 0), adsk.core.Vector3D.create(0, 0, 1), adsk.core.Vector3D.create(1, 0, 0)) 1358 | angleValueInput2.hasMinimumValue = False 1359 | angleValueInput2.hasMaximumValue = False 1360 | angleValueInput2.isVisible = allvisible 1361 | angleValueInput2.isEnabled = allenabled 1362 | 1363 | # Create angle value input 3. 1364 | angleValueInput3 = jtctrl.addAngleValueCommandInput('angleValueYaw', 'Yaw', adsk.core.ValueInput.createByReal(0))#self.yaw+epsilon)) 1365 | angleValueInput3.setManipulator(adsk.core.Point3D.create(0, 0, 0), adsk.core.Vector3D.create(1, 0, 0), adsk.core.Vector3D.create(0, 1, 0)) 1366 | angleValueInput3.hasMinimumValue = False 1367 | angleValueInput3.hasMaximumValue = False 1368 | angleValueInput3.isVisibile = allvisible 1369 | angleValueInput3.isEnabled = allenabled 1370 | 1371 | 1372 | # Create a selection input. 1373 | selectionInput2 =myjointgroup.children.addSelectionInput('jointselection', 'Select Joint', 'Basic select command input') 1374 | selectionInput2.addSelectionFilter('Joints') 1375 | selectionInput2.setSelectionLimits(1) 1376 | selectionInput2.isEnabled = False 1377 | 1378 | # Create a string value input. 1379 | parentlinkin = myjointgroup.children.addDropDownCommandInput('parentlinkname', 'Name of parent link', 1) 1380 | 1381 | childlinkin = myjointgroup.children.addDropDownCommandInput('childlinkname', 'Name of child link', 1) 1382 | 1383 | 1384 | 1385 | except: 1386 | _ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 1387 | 1388 | 1389 | def createpaths(_ms_packagename): 1390 | folderDlg = _ui.createFolderDialog() 1391 | folderDlg.title = 'Choose location to save your URDF new package' 1392 | folderDlg.initialDirectory = os.path.join(os.path.expanduser("~"),'Documents') 1393 | dlgResult = folderDlg.showDialog() 1394 | if dlgResult != adsk.core.DialogResults.DialogOK: 1395 | _ui.messageBox('you need to select a folder!') 1396 | raise ValueError('Directory not selected. cannot continue.') 1397 | outputdir = os.path.join(folderDlg.folder,_ms_packagename) 1398 | thisscriptpath = os.path.dirname(os.path.realpath(__file__)) 1399 | base_directory = os.path.abspath(outputdir) 1400 | _ui.messageBox(base_directory) 1401 | if not os.path.exists(base_directory): 1402 | os.makedirs(base_directory) 1403 | meshes_directory = os.path.join(base_directory, "meshes/") 1404 | _ui.messageBox( meshes_directory) 1405 | components_directory = os.path.join(base_directory, "components/") 1406 | _ui.messageBox(components_directory) 1407 | if not os.path.exists(meshes_directory): 1408 | os.makedirs(meshes_directory) 1409 | if not os.path.exists(components_directory): 1410 | os.makedirs(components_directory) 1411 | 1412 | filestochange = ['display.launch', 'urdf_.rviz', 'package.xml', 'CMakeLists.txt' ] ##actually urdf.rviz is the same, but i didnt want to make another method just to copy. when i have more files i need to copy i will do it. 1413 | #myfilename = 'display.launch' 1414 | for myfilename in filestochange: 1415 | # Read in the file 1416 | #_ui.messageBox(thisscriptpath) 1417 | with open( os.path.join(thisscriptpath,'resources/', myfilename), 'r') as file : 1418 | filedata = file.read() 1419 | 1420 | # Replace the target string 1421 | filedata = filedata.replace('somepackage', _ms_packagename) 1422 | 1423 | # Write the file out again 1424 | with open( os.path.join(base_directory, myfilename), 'w') as file: 1425 | file.write(filedata) 1426 | return base_directory, meshes_directory, components_directory 1427 | 1428 | thisdocsunits = '' 1429 | 1430 | class GenSTLCommandCreatedHandler(adsk.core.CommandCreatedEventHandler): 1431 | def __init__(self): 1432 | super().__init__() 1433 | def notify(self, args): 1434 | try: 1435 | global _ui, _design 1436 | _app = adsk.core.Application.get() 1437 | #_ui = _app.userInterface 1438 | product = _app.activeProduct 1439 | _design = adsk.fusion.Design.cast(product) 1440 | # # Get the command that was created. 1441 | # cmd = adsk.core.Command.cast(args.command) 1442 | # 1443 | # # Connect to the command destroyed event. 1444 | # onDestroy = GenSTLCommandDestroyHandler() 1445 | # cmd.destroy.add(onDestroy) 1446 | # _handlers.append(onDestroy) 1447 | # 1448 | # # Connect to the input changed event. 1449 | # onInputChanged = GenSTLCommandInputChangedHandler() 1450 | # cmd.inputChanged.add(onInputChanged) 1451 | # _handlers.append(onInputChanged) 1452 | # 1453 | # onExecute = GenSTLCommandExecuteHandler() 1454 | # cmd.execute.add(onExecute) 1455 | # _handlers.append(onExecute) 1456 | 1457 | 1458 | 1459 | logging.debug('starting genSTL') 1460 | # Get the root component of the active design 1461 | rootComp = _design.rootComponent 1462 | 1463 | # Create two new components under root component 1464 | allOccs = rootComp.allOccurrences 1465 | 1466 | # create a single exportManager instance 1467 | exportMgr = _design.exportManager 1468 | 1469 | 1470 | fileDlg = _ui.createFileDialog() 1471 | fileDlg.isMultiSelectEnabled = False 1472 | fileDlg.title = 'Choose location to save your STL ' 1473 | fileDlg.filter = '*.stl' 1474 | fileDlg.initialDirectory = os.path.join(os.path.expanduser("~"),'Documents') 1475 | dlgResult = fileDlg.showSave() 1476 | if dlgResult != adsk.core.DialogResults.DialogOK: 1477 | _ui.messageBox('you need to select a folder!') 1478 | return 1479 | 1480 | # export the root component to printer utility 1481 | stlRootOptions = exportMgr.createSTLExportOptions(rootComp, fileDlg.filename) 1482 | 1483 | # get all available print utilities 1484 | #printUtils = stlRootOptions.availablePrintUtilities 1485 | 1486 | # export the root component to the print utility, instead of a specified file 1487 | #for printUtil in printUtils: 1488 | # stlRootOptions.sendToPrintUtility = True 1489 | # stlRootOptions.printUtility = printUtil 1490 | stlRootOptions.sendToPrintUtility = False 1491 | logging.info('saving STL file: '+ fileDlg.filename) 1492 | exportMgr.execute(stlRootOptions) 1493 | _ui.messageBox('file {} saved successfully'.format(fileDlg.filename)) 1494 | 1495 | except: 1496 | logging.error('Failed:\n{}'.format(traceback.format_exc())) 1497 | _ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 1498 | 1499 | def run(context): 1500 | try: 1501 | global _app, _ui, _design, _ms, thisdocsunits 1502 | _app = adsk.core.Application.get() 1503 | _ui = _app.userInterface 1504 | product = _app.activeProduct 1505 | _design = adsk.fusion.Design.cast(product) 1506 | 1507 | #createpaths('batatas') 1508 | thisdocsunits = _design.unitsManager.defaultLengthUnits 1509 | 1510 | #if thisdocsunits != 'm': 1511 | # _ui.messageBox('So, funny thing, I have no idea on how to set default units and set them back using this API. As far as I am aware, it is currently(18-08-2018) impossible. So you need to change this documents units to meters and also make meters default for the URDF to be generated the right way - I have to create new documents, so if you don''t change the default, it won''t work\n. Once Autodesk either responds my forum question, or fixes ExportManager or allows for non-uniform affine transformations, this will no longer be necessary. ') 1512 | # return 1513 | #a = adsk.core.Matrix3D.create() 1514 | 1515 | for handler in logging.root.handlers[:]: 1516 | logging.root.removeHandler(handler) 1517 | FORMAT = "[%(filename)s:%(lineno)s - %(funcName)20s() ] %(levelname)s: %(message)s" 1518 | logging.basicConfig(filename=os.path.join(os.path.expanduser("~"),'urdfgen.log'),level=logging.DEBUG,format=FORMAT) 1519 | 1520 | workSpace = _ui.workspaces.itemById('FusionSolidEnvironment') 1521 | tbPanels = workSpace.toolbarPanels 1522 | 1523 | # global tbPanel 1524 | tbPanel = tbPanels.itemById('SolidScriptsAddinsPanel') 1525 | # if tbPanel: 1526 | # tbPanel.deleteMe() 1527 | # tbPanel = tbPanels.add('NewPanel', 'New Panel', 'SolidScriptsAddinsPanel', False) 1528 | 1529 | 1530 | # Get the existing command definition or create it if it doesn't already exist. 1531 | addlinkcmdDef = _ui.commandDefinitions.itemById('cmdInputsAddLink') 1532 | if not addlinkcmdDef: 1533 | addlinkcmdDef = _ui.commandDefinitions.addButtonDefinition('cmdInputsAddLink', 'Make URDF', 'My attempt to make an URDF.') 1534 | else: 1535 | pass 1536 | 1537 | genSTLcmdDef = _ui.commandDefinitions.itemById('cmdInputsgenSTL') 1538 | if not genSTLcmdDef: 1539 | genSTLcmdDef = _ui.commandDefinitions.addButtonDefinition('cmdInputsgenSTL', 'Generate STL', 'Generate single STL (in case some of them are incorrect/changed)') 1540 | else: 1541 | pass 1542 | 1543 | # Connect to the command created event. 1544 | onCommandCreated = AddLinkCommandCreatedHandler() 1545 | addlinkcmdDef.commandCreated.add(onCommandCreated) 1546 | _handlers.append(onCommandCreated) 1547 | 1548 | on2CommandCreated = GenSTLCommandCreatedHandler() 1549 | genSTLcmdDef.commandCreated.add(on2CommandCreated) 1550 | _handlers.append(on2CommandCreated) 1551 | #_ms.thistree = UrdfTree() 1552 | if runfrommenu: 1553 | 1554 | # will try to create a button for this guy 1555 | # but first morruca 1556 | while tbPanel.controls.itemById('cmdInputsAddLink'): 1557 | a = tbPanel.controls.itemById('cmdInputsAddLink') 1558 | a.deleteMe() 1559 | 1560 | while tbPanel.controls.itemById('cmdInputsgenSTL'): 1561 | a = tbPanel.controls.itemById('cmdInputsgenSTL') 1562 | a.deleteMe() 1563 | 1564 | tbPanel.controls.addCommand(addlinkcmdDef) 1565 | tbPanel.controls.addCommand(genSTLcmdDef) 1566 | 1567 | else: 1568 | # _ms = MotherShip() 1569 | # Execute the command definition. 1570 | addlinkcmdDef.execute() 1571 | 1572 | # Prevent this module from being terminated when the script returns, because we are waiting for event handlers to fire. 1573 | #adsk.autoTerminate(False) 1574 | 1575 | except: 1576 | #i need to close and destroy stuff otherwise Fusion crashes... 1577 | try: 1578 | logging.info("shutting down from failure or debugquit.") 1579 | # When the command is done, terminate the script 1580 | # This will release all globals which will remove all event handlers 1581 | if runfrommenu: 1582 | for handler in logging.root.handlers[:]: 1583 | handler.close() 1584 | logging.root.removeHandler(handler) 1585 | 1586 | del(_ms) 1587 | _ms = [] 1588 | if runfrommenu: 1589 | pass 1590 | #adsk.terminate() 1591 | except: 1592 | _ui.messageBox('Failed in shutdown sequence!:\n{}'.format(traceback.format_exc())) 1593 | if _ui: 1594 | _ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 1595 | 1596 | def stop(context): 1597 | global _ui,_app,_design,_handlers,_ms,runfrommenu 1598 | logging.info("stopping addin urdfgen") 1599 | 1600 | try: 1601 | workSpace = _ui.workspaces.itemById('FusionSolidEnvironment') 1602 | tbPanels = workSpace.toolbarPanels 1603 | 1604 | tbPanel = tbPanels.itemById('SolidScriptsAddinsPanel') 1605 | 1606 | #genSTLcmdDef = _ui.commandDefinitions.itemById('cmdInputsgenSTL') 1607 | #addlinkcmdDef = _ui.commandDefinitions.itemById('cmdInputsAddLink') 1608 | logging.info("stopping addin2") 1609 | if runfrommenu: 1610 | while tbPanel.controls.itemById('cmdInputsAddLink'): 1611 | logging.info("stopping addin3") 1612 | a = tbPanel.controls.itemById('cmdInputsAddLink') 1613 | a.deleteMe() 1614 | 1615 | while tbPanel.controls.itemById('cmdInputsgenSTL'): 1616 | logging.info("stopping addin4") 1617 | a = tbPanel.controls.itemById('cmdInputsgenSTL') 1618 | a.deleteMe() 1619 | logging.info("stopping addin5") 1620 | _ui.messageBox('Stop addin urdfgen') 1621 | #_app = None 1622 | #_ui = None 1623 | #_design = None 1624 | 1625 | # 1626 | 1627 | # Global set of event handlers to keep them referenced for the duration of the command 1628 | _handlers = [] 1629 | _ms = [] 1630 | #del(_ui,_app,_design,_handlers,_ms,runfrommenu) 1631 | #adsk.terminate() 1632 | logging.info("stopping addin6") 1633 | except: 1634 | logging.error('Failed hard while stopping:\n{}'.format(traceback.format_exc())) 1635 | if _ui: 1636 | _ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) --------------------------------------------------------------------------------