-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This PR adds force/torque actuation/reading methods to the class 'DQ_VrepInterface' #104
This PR adds force/torque actuation/reading methods to the class 'DQ_VrepInterface' #104
Conversation
…t allows reading the force/torques of a force sensor in V-REP/CoppeliaSim.
…the class DQ_VrepInterface.
Hi @ffasilva, thank you for your PR. [suggestion] function [force_vec, torque_vec, return_code, state_sensor] = get_force_sensor_readings(obj,handle,opmode)
end does not follow the signature style of other methods in Best regards, Juancho Update:Additional suggestions:
[joint_torques,return_code] = get_joint_torques(obj,handles,opmode) To joint_torques = get_joint_torques(obj,handles,opmode) to keep the same signature style of the other methods in
%% Get the readings of a force sensor in V-REP. For joints that are in 'Torque/force mode' in V-REP
%% >> force_sensor_name = 'Sensor_name_in_VREP';
%% >> [force_vec, torque_vec] = vi.get_force_sensor_readings(force_sensor_handle); Expected (this is an example of the method get_joint_velocities): function joint_velocities = get_joint_velocities(obj,jointnames,opmode)
% This method gets the joint velocities of a robot in the CoppeliaSim scene.
% Usage:
% Recommended:
% joint_velocities = get_joint_velocities(jointnames);
%
% Advanced:
% joint_velocities = get_joint_velocities(jointnames, opmode)
%
% jointnames: The joint names.
% (optional) opmode: The operation mode. If not specified,
% the opmode will be set automatically.
%
% You can use the following modes:
% OP_BLOCKING
% OP_STREAMING
% OP_ONESHOT
% OP_BUFFER;
%
% Check this link for more details:
% https://www.coppeliarobotics.com/helpFiles/en/remoteApiModusOperandi.htm
%
% Example:
% jointnames={'LBR4p_joint1','LBR4p_joint2','LBR4p_joint3','LBR4p_joint4',...
% 'LBR4p_joint5','LBR4p_joint6','LBR4p_joint7'};
%
% % Recommended:
% joint_velocities = get_joint_velocities(jointnames);
%
% % Advanced usage:
% joint_velocities = get_joint_velocities(jointnames, OP_ONESHOT); |
…d_tau_to_vrep()' and 'get_tau_from_vrep()' to class 'LBR4pVrepRobot'.
…int_torques' in class 'DQ_VrepInterface'.
Hi @juanjqo, Thank your for the suggestions. I have made the following modifications in the pull request:
However, I did not modify the signature of the method [joint_positions,retval] = get_joint_positions(obj,jointnames,opmode) in the class joint_torques = get_joint_torques(obj,handles,opmode) Finally, I have added the methods Kind regards, |
@dqrobotics/developers Hi @ffasilva. As far as I know, the signature of the method [joint_positions,retval] = get_joint_positions(obj,jointnames,opmode) , which was implemented by @mmmarinho in bb3a836, is supposed to be deprecated. The current signatures for public getter methods only return a single parameter. Example: C++: VectorXd get_joint_positions(const std::vector<std::string>& jointnames, const OP_MODES& opmode=OP_AUTOMATIC);
VectorXd get_joint_velocities(const std::vector<std::string>& jointnames, const OP_MODES& opmode=OP_AUTOMATIC);
VectorXd get_joint_torques(const std::vector<std::string>& jointnames, const OP_MODES& opmode=OP_AUTOMATIC); Bindings (Python): dqvrepinterface_py.def("get_joint_positions",
(VectorXd (DQ_VrepInterface::*) (const std::vector<std::string>&, const DQ_VrepInterface::OP_MODES&))&DQ_VrepInterface::get_joint_positions,
"Get joint positions",
py::arg("jointnames")=std::vector<std::string>(),
py::arg("opmode")=DQ_VrepInterface::OP_AUTOMATIC);
dqvrepinterface_py.def("set_joint_target_velocities",
(void (DQ_VrepInterface::*) (const std::vector<std::string>&, const VectorXd&, const DQ_VrepInterface::OP_MODES&))&DQ_VrepInterface::set_joint_target_velocities,
"Set joint velcoties",
py::arg("jointnames")=std::vector<std::string>(),
py::arg("angles_dot_rad")=VectorXd::Zero(1),
py::arg("opmode")=DQ_VrepInterface::OP_ONESHOT);
dqvrepinterface_py.def("get_joint_torques",
(VectorXd (DQ_VrepInterface::*) (const std::vector<std::string>&, const DQ_VrepInterface::OP_MODES&))&DQ_VrepInterface::get_joint_torques,
"Get joint torques",
py::arg("jointnames")=std::vector<std::string>(),
py::arg("opmode")=DQ_VrepInterface::OP_AUTOMATIC); If we decide to change that, we would need to reimplement all methods in C++ and Python in order to keep the compatibility between the languages. It looks like a lot of work for little gain. Maybe @bvadorno and @mmmarinho could guide us concerning this topic. Best regards, Juancho |
@dqrobotics/developers My 2 cents on this. The [joint_positions,retval] = get_joint_positions(obj,jointnames,opmode) should be removed to comply with the other signatures in MATLAB and other languages. The If the MATLAB code is depending on it for some reason (hopefully it isn't), it was a mistake in my first implementation of this method, and it should be fixed to not need it. |
Hi @dqrobotics/developers, Following @juanjqo and @mmmarinho's comments, it's settled. Let's remove @ffasilva, may you adjust your pull request accordingly? Many thanks, |
Hi @ffasilva, Any news on this? All the best, |
Hi @ffasilva, It looks like some of your commit messages do not follow the DQ Robotics convention described in CONTRIBUTING.md. Please update the message style in your new commits accordingly.
Best regards, Juancho |
Hi @juanjqo, I changed the signature of joint_torques = get_joint_torques(obj,handles,opmode) Kind regards, |
Hi @ffasilva, thanks. There are no methods Therefore, I recommend removing the modifications in Best regards, Juancho |
Hi @juanjqo, I removed the methods I didn't update the example because it can't do anything without those methods. I suggest we leave it open, and I'll updated it after I implement the class @bvadorno, I was going through the tasks following the order we had in the checklist. However, it's clear to me know it's better to skip to the implementation of the class Kind regards, |
Hi @juanjqo,
Updated in a50de7e. Kind regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ffasilva thank you for your example. I just added minor comments.
…github.com/ffasilva/matlab into dq-vrepinterface-get-force-sensor-readings
…'set_joint_torques'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bvadorno I have no more comments for this PR.
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,
Added the following methods to the class
DQ_VrepInterface
:get_joint_torques()
set_joint_torques()
get_force_sensor_readings()
Also added the class
FrankaEmikaPandaVrepRobot
.Kind regards,
Frederico
Rationale
All the new methods added to the class
DQ_VrepInterface
are related to force/torque actuation/reading. The classFrankaEmikaPandaVrepRobot
is used for the V-REP example of application of the new methods given in 8.