From dea5122f2e3193c8a7aaa26075b0e800e3d2937a Mon Sep 17 00:00:00 2001 From: samuel-cavalcanti Date: Fri, 15 Sep 2023 15:35:30 -0300 Subject: [PATCH] formated sim.rs and sim_ik.rs --- c_transpiler/assets/sim.rs | 1 - c_transpiler/assets/sim_ik.rs | 161 +++++++++++++++++----------------- 2 files changed, 81 insertions(+), 81 deletions(-) diff --git a/c_transpiler/assets/sim.rs b/c_transpiler/assets/sim.rs index 6a58915..cec6dc7 100644 --- a/c_transpiler/assets/sim.rs +++ b/c_transpiler/assets/sim.rs @@ -385,4 +385,3 @@ pub trait Sim: RemoteApiClientInterface { (yaw_pitch_roll_to_alpha_beta_gamma,"yawPitchRollToAlphaBetaGamma",(yaw_angle:f64,pitch_angle:f64,roll_angle:f64)->(f64,f64,f64)) } } - diff --git a/c_transpiler/assets/sim_ik.rs b/c_transpiler/assets/sim_ik.rs index 1f5eafe..9dd13e1 100644 --- a/c_transpiler/assets/sim_ik.rs +++ b/c_transpiler/assets/sim_ik.rs @@ -1,81 +1,82 @@ -pub trait SimIk : RemoteApiClientInterface { - requests!{ -"sim_ik", -(add_element,"addElement",(environment_handle:i64,ik_group_handle:i64,tip_dummy_handle:i64)->i64) , -(add_element_from_scene,"addElementFromScene",(environment_handle:i64,ik_group:i64,base_handle:i64,tip_handle:i64,target_handle:i64,constraints:i64)->(i64,serde_json::Value,serde_json::Value)) , -(compute_group_jacobian,"computeGroupJacobian",(environment_handle:i64,ik_group_handle:i64)->(Vec,Vec)) , -(compute_jacobian,"computeJacobian",(environment_handle:i64,base_object:i64,last_joint:i64,constraints:i64,tip_matrix:Vec),opt(target_matrix:Vec,constr_base_matrix:Vec)->(Vec,Vec)) , -(create_debug_overlay,"createDebugOverlay",(environment_handle:i64,tip_handle:i64),opt(base_handle:i64)->i64) , -(create_dummy,"createDummy",(environment_handle:i64),opt(dummy_name:String)->i64) , -(create_environment,"createEnvironment",opt(flags:i64)->i64) , -(create_group,"createGroup",(environment_handle:i64),opt(ik_group_name:String)->i64) , -(create_joint,"createJoint",(environment_handle:i64,joint_type:i64),opt(joint_name:String)->i64) , -(does_group_exist,"doesGroupExist",(environment_handle:i64,ik_group_name:String)->bool) , -(does_object_exist,"doesObjectExist",(environment_handle:i64,object_name:String)->bool) , -(duplicate_environment,"duplicateEnvironment",(environment_handle:i64)->i64) , -(erase_debug_overlay,"eraseDebugOverlay",(debug_object:i64)->()) , -(erase_environment,"eraseEnvironment",(environment_handle:i64)->()) , -(erase_object,"eraseObject",(environment_handle:i64,object_handle:i64)->()) , -(find_config,"findConfig",(environment_handle:i64,ik_group_handle:i64,joint_handles:Vec),opt(threshold_dist:f64,max_time:f64,metric:Vec,validation_callback:String,aux_data:serde_json::Value)->Vec) , -(generate_path,"generatePath",(environment_handle:i64,ik_group_handle:i64,joint_handles:Vec,tip_handle:i64,path_point_count:i64),opt(validation_callback:String,aux_data:serde_json::Value)->Vec) , -(get_alternate_configs,"getAlternateConfigs",(environment_handle:i64,joint_handles:Vec),opt(low_limits:Vec,ranges:Vec)->Vec) , -(get_element_base,"getElementBase",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->(i64,i64)) , -(get_element_constraints,"getElementConstraints",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->i64) , -(get_element_flags,"getElementFlags",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->i64) , -(get_element_precision,"getElementPrecision",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->Vec) , -(get_element_weights,"getElementWeights",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->Vec) , -(get_failure_description,"getFailureDescription",(reason:i64)->String) , -(get_group_calculation,"getGroupCalculation",(environment_handle:i64,ik_group_handle:i64)->(i64,f64,i64)) , -(get_group_flags,"getGroupFlags",(environment_handle:i64,ik_group_handle:i64)->i64) , -(get_group_handle,"getGroupHandle",(environment_handle:i64,ik_group_name:String)->i64) , -(get_group_joint_limit_hits,"getGroupJointLimitHits",(environment_handle:i64,ik_group_handle:i64)->(Vec,Vec)) , -(get_group_joints,"getGroupJoints",(environment_handle:i64,ik_group_handle:i64)->Vec) , -(get_joint_dependency,"getJointDependency",(environment_handle:i64,joint_handle:i64)->(i64,f64,f64)) , -(get_joint_interval,"getJointInterval",(environment_handle:i64,joint_handle:i64)->(bool,Vec)) , -(get_joint_limit_margin,"getJointLimitMargin",(environment_handle:i64,joint_handle:i64)->f64) , -(get_joint_matrix,"getJointMatrix",(environment_handle:i64,joint_handle:i64)->Vec) , -(get_joint_max_step_size,"getJointMaxStepSize",(environment_handle:i64,joint_handle:i64)->f64) , -(get_joint_mode,"getJointMode",(environment_handle:i64,joint_handle:i64)->i64) , -(get_joint_position,"getJointPosition",(environment_handle:i64,joint_handle:i64)->f64) , -(get_joint_screw_lead,"getJointScrewLead",(environment_handle:i64,joint_handle:i64)->f64) , -(get_joint_transformation,"getJointTransformation",(environment_handle:i64,joint_handle:i64)->(Vec,Vec,Vec)) , -(get_joint_type,"getJointType",(environment_handle:i64,joint_handle:i64)->i64) , -(get_joint_weight,"getJointWeight",(environment_handle:i64,joint_handle:i64)->f64) , -(get_object_handle,"getObjectHandle",(environment_handle:i64,object_name:String)->i64) , -(get_object_matrix,"getObjectMatrix",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64)->Vec) , -(get_object_parent,"getObjectParent",(environment_handle:i64,object_handle:i64)->i64) , -(get_object_pose,"getObjectPose",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64)->Vec) , -(get_object_transformation,"getObjectTransformation",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64)->(Vec,Vec,Vec)) , -(get_object_type,"getObjectType",(environment_handle:i64,object_handle:i64)->i64) , -(get_objects,"getObjects",(environment_handle:i64,index:i64)->(i64,String,bool,i64)) , -(get_target_dummy,"getTargetDummy",(environment_handle:i64,dummy_handle:i64)->i64) , -(handle_group,"handleGroup",(environment_handle:i64,ik_group:i64),opt(options:serde_json::Value)->(i64,i64,Vec)) , -(handle_groups,"handleGroups",(environment_handle:i64,ik_groups:Vec),opt(options:serde_json::Value)->(i64,i64,Vec)) , -(load,"load",(environment_handle:i64,data:String)->()) , -(save,"save",(environment_handle:i64)->String) , -(set_element_base,"setElementBase",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,base_handle:i64),opt(constraints_base_handle:i64)->()) , -(set_element_constraints,"setElementConstraints",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,constraints:i64)->()) , -(set_element_flags,"setElementFlags",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,flags:i64)->()) , -(set_element_precision,"setElementPrecision",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,precision:Vec)->()) , -(set_element_weights,"setElementWeights",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,weights:Vec)->()) , -(set_group_calculation,"setGroupCalculation",(environment_handle:i64,ik_group_handle:i64,method:i64,damping:f64,max_iterations:i64)->()) , -(set_group_flags,"setGroupFlags",(environment_handle:i64,ik_group_handle:i64,flags:i64)->()) , -(set_joint_dependency,"setJointDependency",(environment_handle:i64,joint_handle:i64,master_joint_handle:i64),opt(offset:f64,mult:f64,callback:String)->()) , -(set_joint_interval,"setJointInterval",(environment_handle:i64,joint_handle:i64,cyclic:bool),opt(interval:Vec)->()) , -(set_joint_limit_margin,"setJointLimitMargin",(environment_handle:i64,joint_handle:i64,margin:f64)->()) , -(set_joint_max_step_size,"setJointMaxStepSize",(environment_handle:i64,joint_handle:i64,step_size:f64)->()) , -(set_joint_mode,"setJointMode",(environment_handle:i64,joint_handle:i64,joint_mode:i64)->()) , -(set_joint_position,"setJointPosition",(environment_handle:i64,joint_handle:i64,position:f64)->()) , -(set_joint_screw_lead,"setJointScrewLead",(environment_handle:i64,joint_handle:i64,lead:f64)->()) , -(set_joint_weight,"setJointWeight",(environment_handle:i64,joint_handle:i64,weight:f64)->()) , -(set_object_matrix,"setObjectMatrix",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64,matrix:Vec)->()) , -(set_object_parent,"setObjectParent",(environment_handle:i64,object_handle:i64,parent_object_handle:i64),opt(keep_in_place:bool)->()) , -(set_object_pose,"setObjectPose",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64,pose:Vec)->()) , -(set_object_transformation,"setObjectTransformation",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64,position:Vec,euler_or_quaternion:Vec)->()) , -(set_spherical_joint_matrix,"setSphericalJointMatrix",(environment_handle:i64,joint_handle:i64,matrix:Vec)->()) , -(set_spherical_joint_rotation,"setSphericalJointRotation",(environment_handle:i64,joint_handle:i64,euler_or_quaternion:Vec)->()) , -(set_target_dummy,"setTargetDummy",(environment_handle:i64,dummy_handle:i64,target_dummy_handle:i64)->()) , -(sync_from_sim,"syncFromSim",(environment_handle:i64,ik_groups:Vec)->()) , -(sync_to_sim,"syncToSim",(environment_handle:i64,ik_groups:Vec)->()) +pub trait SimIk: RemoteApiClientInterface { + requests! { + "sim_ik", + (add_element,"addElement",(environment_handle:i64,ik_group_handle:i64,tip_dummy_handle:i64)->i64) , + (add_element_from_scene,"addElementFromScene",(environment_handle:i64,ik_group:i64,base_handle:i64,tip_handle:i64,target_handle:i64,constraints:i64)->(i64,serde_json::Value,serde_json::Value)) , + (compute_group_jacobian,"computeGroupJacobian",(environment_handle:i64,ik_group_handle:i64)->(Vec,Vec)) , + (compute_jacobian,"computeJacobian",(environment_handle:i64,base_object:i64,last_joint:i64,constraints:i64,tip_matrix:Vec),opt(target_matrix:Vec,constr_base_matrix:Vec)->(Vec,Vec)) , + (create_debug_overlay,"createDebugOverlay",(environment_handle:i64,tip_handle:i64),opt(base_handle:i64)->i64) , + (create_dummy,"createDummy",(environment_handle:i64),opt(dummy_name:String)->i64) , + (create_environment,"createEnvironment",opt(flags:i64)->i64) , + (create_group,"createGroup",(environment_handle:i64),opt(ik_group_name:String)->i64) , + (create_joint,"createJoint",(environment_handle:i64,joint_type:i64),opt(joint_name:String)->i64) , + (does_group_exist,"doesGroupExist",(environment_handle:i64,ik_group_name:String)->bool) , + (does_object_exist,"doesObjectExist",(environment_handle:i64,object_name:String)->bool) , + (duplicate_environment,"duplicateEnvironment",(environment_handle:i64)->i64) , + (erase_debug_overlay,"eraseDebugOverlay",(debug_object:i64)->()) , + (erase_environment,"eraseEnvironment",(environment_handle:i64)->()) , + (erase_object,"eraseObject",(environment_handle:i64,object_handle:i64)->()) , + (find_config,"findConfig",(environment_handle:i64,ik_group_handle:i64,joint_handles:Vec),opt(threshold_dist:f64,max_time:f64,metric:Vec,validation_callback:String,aux_data:serde_json::Value)->Vec) , + (generate_path,"generatePath",(environment_handle:i64,ik_group_handle:i64,joint_handles:Vec,tip_handle:i64,path_point_count:i64),opt(validation_callback:String,aux_data:serde_json::Value)->Vec) , + (get_alternate_configs,"getAlternateConfigs",(environment_handle:i64,joint_handles:Vec),opt(low_limits:Vec,ranges:Vec)->Vec) , + (get_element_base,"getElementBase",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->(i64,i64)) , + (get_element_constraints,"getElementConstraints",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->i64) , + (get_element_flags,"getElementFlags",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->i64) , + (get_element_precision,"getElementPrecision",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->Vec) , + (get_element_weights,"getElementWeights",(environment_handle:i64,ik_group_handle:i64,element_handle:i64)->Vec) , + (get_failure_description,"getFailureDescription",(reason:i64)->String) , + (get_group_calculation,"getGroupCalculation",(environment_handle:i64,ik_group_handle:i64)->(i64,f64,i64)) , + (get_group_flags,"getGroupFlags",(environment_handle:i64,ik_group_handle:i64)->i64) , + (get_group_handle,"getGroupHandle",(environment_handle:i64,ik_group_name:String)->i64) , + (get_group_joint_limit_hits,"getGroupJointLimitHits",(environment_handle:i64,ik_group_handle:i64)->(Vec,Vec)) , + (get_group_joints,"getGroupJoints",(environment_handle:i64,ik_group_handle:i64)->Vec) , + (get_joint_dependency,"getJointDependency",(environment_handle:i64,joint_handle:i64)->(i64,f64,f64)) , + (get_joint_interval,"getJointInterval",(environment_handle:i64,joint_handle:i64)->(bool,Vec)) , + (get_joint_limit_margin,"getJointLimitMargin",(environment_handle:i64,joint_handle:i64)->f64) , + (get_joint_matrix,"getJointMatrix",(environment_handle:i64,joint_handle:i64)->Vec) , + (get_joint_max_step_size,"getJointMaxStepSize",(environment_handle:i64,joint_handle:i64)->f64) , + (get_joint_mode,"getJointMode",(environment_handle:i64,joint_handle:i64)->i64) , + (get_joint_position,"getJointPosition",(environment_handle:i64,joint_handle:i64)->f64) , + (get_joint_screw_lead,"getJointScrewLead",(environment_handle:i64,joint_handle:i64)->f64) , + (get_joint_transformation,"getJointTransformation",(environment_handle:i64,joint_handle:i64)->(Vec,Vec,Vec)) , + (get_joint_type,"getJointType",(environment_handle:i64,joint_handle:i64)->i64) , + (get_joint_weight,"getJointWeight",(environment_handle:i64,joint_handle:i64)->f64) , + (get_object_handle,"getObjectHandle",(environment_handle:i64,object_name:String)->i64) , + (get_object_matrix,"getObjectMatrix",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64)->Vec) , + (get_object_parent,"getObjectParent",(environment_handle:i64,object_handle:i64)->i64) , + (get_object_pose,"getObjectPose",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64)->Vec) , + (get_object_transformation,"getObjectTransformation",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64)->(Vec,Vec,Vec)) , + (get_object_type,"getObjectType",(environment_handle:i64,object_handle:i64)->i64) , + (get_objects,"getObjects",(environment_handle:i64,index:i64)->(i64,String,bool,i64)) , + (get_target_dummy,"getTargetDummy",(environment_handle:i64,dummy_handle:i64)->i64) , + (handle_group,"handleGroup",(environment_handle:i64,ik_group:i64),opt(options:serde_json::Value)->(i64,i64,Vec)) , + (handle_groups,"handleGroups",(environment_handle:i64,ik_groups:Vec),opt(options:serde_json::Value)->(i64,i64,Vec)) , + (load,"load",(environment_handle:i64,data:String)->()) , + (save,"save",(environment_handle:i64)->String) , + (set_element_base,"setElementBase",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,base_handle:i64),opt(constraints_base_handle:i64)->()) , + (set_element_constraints,"setElementConstraints",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,constraints:i64)->()) , + (set_element_flags,"setElementFlags",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,flags:i64)->()) , + (set_element_precision,"setElementPrecision",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,precision:Vec)->()) , + (set_element_weights,"setElementWeights",(environment_handle:i64,ik_group_handle:i64,element_handle:i64,weights:Vec)->()) , + (set_group_calculation,"setGroupCalculation",(environment_handle:i64,ik_group_handle:i64,method:i64,damping:f64,max_iterations:i64)->()) , + (set_group_flags,"setGroupFlags",(environment_handle:i64,ik_group_handle:i64,flags:i64)->()) , + (set_joint_dependency,"setJointDependency",(environment_handle:i64,joint_handle:i64,master_joint_handle:i64),opt(offset:f64,mult:f64,callback:String)->()) , + (set_joint_interval,"setJointInterval",(environment_handle:i64,joint_handle:i64,cyclic:bool),opt(interval:Vec)->()) , + (set_joint_limit_margin,"setJointLimitMargin",(environment_handle:i64,joint_handle:i64,margin:f64)->()) , + (set_joint_max_step_size,"setJointMaxStepSize",(environment_handle:i64,joint_handle:i64,step_size:f64)->()) , + (set_joint_mode,"setJointMode",(environment_handle:i64,joint_handle:i64,joint_mode:i64)->()) , + (set_joint_position,"setJointPosition",(environment_handle:i64,joint_handle:i64,position:f64)->()) , + (set_joint_screw_lead,"setJointScrewLead",(environment_handle:i64,joint_handle:i64,lead:f64)->()) , + (set_joint_weight,"setJointWeight",(environment_handle:i64,joint_handle:i64,weight:f64)->()) , + (set_object_matrix,"setObjectMatrix",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64,matrix:Vec)->()) , + (set_object_parent,"setObjectParent",(environment_handle:i64,object_handle:i64,parent_object_handle:i64),opt(keep_in_place:bool)->()) , + (set_object_pose,"setObjectPose",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64,pose:Vec)->()) , + (set_object_transformation,"setObjectTransformation",(environment_handle:i64,object_handle:i64,relative_to_object_handle:i64,position:Vec,euler_or_quaternion:Vec)->()) , + (set_spherical_joint_matrix,"setSphericalJointMatrix",(environment_handle:i64,joint_handle:i64,matrix:Vec)->()) , + (set_spherical_joint_rotation,"setSphericalJointRotation",(environment_handle:i64,joint_handle:i64,euler_or_quaternion:Vec)->()) , + (set_target_dummy,"setTargetDummy",(environment_handle:i64,dummy_handle:i64,target_dummy_handle:i64)->()) , + (sync_from_sim,"syncFromSim",(environment_handle:i64,ik_groups:Vec)->()) , + (sync_to_sim,"syncToSim",(environment_handle:i64,ik_groups:Vec)->()) + } } -} \ No newline at end of file +