This PR adds methods to get an object's inertial parameters in CoppeliaSim to the class 'DQ_VrepInterface' #109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Main instructions
By submitting this pull request, you automatically agree that you have read and accepted the following conditions:
Description of changes
Hi, @dqrobotics/developers,
I've added to the class
DQ_VrepInterface
:DF_LUA_SCRIPT_API
ST_CHILD
call_script_function()
get_center_of_mass()
get_mass()
get_inertia_matrix()
It diverges from the implementation of its C++ counterpart in the following regards:
DF_LUA_SCRIPT_API
stores the default name (/DQRoboticsApiCommandServer
) for the child script in CoppeliaSim with the LUA methods necessary to read an object's inertia parameters;call_script_function()
follows the signature of the underlying CoppeliaSim API methodsimxCallScriptFunction
;get_center_of_mass()
andget_inertia_matrix()
pass the relative reference frame parameter as an int to methodcall_script_function()
.An example of use is given in 10.
Rationale
The class
DQ_VrepInterface
already has the methodscall_script_function()
,get_center_of_mass()
,get_mass()
, andget_inertia_matrix()
in the C++ library but they were missing on MATLAB.The reasons for the divergence with the C++ implementation are:
call_script_function()
scrambles the input arguments of the underlying CoppeliaSim API methodsimxCallScriptFunction
(e.g.,function_name
goes from being the third argument to being the first). This is unnecessarily confusing and adds no real benefit to its usage.get_center_of_mass()
andget_inertia_matrix()
are in their C++ implementation, they do not allow for arbitrary reference frames. More details on that are given in 10, where I discuss the modifications I've made to the default LUA script used for getting the inertial parameters of an object.Kind regards,
Frederico