Skip to content
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

[REQUEST] Update example "vrep/constrained_kinematic_control" to use the class LBR4pVrepRobot #11

Open
ffasilva opened this issue Aug 6, 2024 · 7 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@ffasilva
Copy link
Member

ffasilva commented Aug 6, 2024


Code of Conduct

By submitting this report you automatically agree that you've read and accepted the following conditions.

  • Support for DQ Robotics is given voluntarily and it's not the developers' role to educate and/or convince anyone of their vision.
  • Any possible response and its timeliness will be based on the relevance, accuracy, and politeness of a request and the following discussion.
  • If a DQ Robotics member replies, the user must let them know if their response solves their issue or not.
  • Any suggestion/advice/request made by anyone, as well intentioned as they might be, might not be incorporated into DQ Robotics.

Hello @dqrobotics/developers,

Request motivation

While working on the DQ_SerialVrepRobot pull request, I realized that the vrep/constrained_kinematic_control example doesn't use the LBR4pVrepRobot class.

Being it a CoppeliaSim usage example, I believe is counterproductive to set both the robot kinematics and the joint names in the main .m file instead teaching the proper use of our VrepRobot classes.

Expected outcome

The example should be updated to use the class LBR4pVrepRobot.

Additional context

This issue is meant to remind me to update this example in the future. However, I lack whatever privilege is needed to assign issues to people; thus, I can't assign myself here. Could someone please do it for me?

Edit: I can't change labels either. Could someone please label this as a "request"?

Kind regards,
Frederico

@ffasilva ffasilva added the bug Something isn't working label Aug 6, 2024
@bvadorno bvadorno added the enhancement New feature or request label Aug 6, 2024
@bvadorno
Copy link
Member

bvadorno commented Aug 6, 2024

Thanks, @ffasilva,

From your comment, I infer that you intend to replace

LBR4p_DH_theta = [0, 0, 0, 0, 0, 0, 0];
LBR4p_DH_d = [0.200, 0, 0.4, 0, 0.39, 0, 0];
LBR4p_DH_a = [0, 0, 0, 0, 0, 0, 0];
LBR4p_DH_alpha = [pi/2, -pi/2, pi/2, -pi/2, pi/2, -pi/2, 0];
LBR4p_DH_type = double(repmat(DQ_JointType.REVOLUTE,1,7));
LBR4p_DH_matrix = [LBR4p_DH_theta;
                    LBR4p_DH_d;
                    LBR4p_DH_a;
                    LBR4p_DH_alpha
                    LBR4p_DH_type];

robot = DQ_SerialManipulatorDH(LBR4p_DH_matrix);
robot.set_effector(1+0.5*DQ.E*DQ.k*0.07);

n = robot.get_dim_configuration_space();
qmin = [-pi -pi -pi/2 -pi -pi/2 -pi -pi/2]';
qmax = [pi pi pi/2 pi pi/2 pi pi/2]';

with a single call to LBR4pVrepRobot. Can you confirm?

When submitting the pull request, I'll assign @juanjqo as the reviewer for this example because he wrote it initially.

Kind regards,
Bruno

@ffasilva
Copy link
Member Author

ffasilva commented Aug 6, 2024

Hi @bvadorno,

Something in this direction. Those lines here

n = robot.get_dim_configuration_space();
qmin = [-pi -pi -pi/2 -pi -pi/2 -pi -pi/2]';
qmax = [pi pi pi/2 pi pi/2 pi pi/2]';

can't really go away, but all of these ones

jointnames={'LBR4p_joint1','LBR4p_joint2',...
            'LBR4p_joint3','LBR4p_joint4',...
            'LBR4p_joint5','LBR4p_joint6',...
            'LBR4p_joint7'};

%---------------------Robot definition--------------------------%
LBR4p_DH_theta = [0, 0, 0, 0, 0, 0, 0];
LBR4p_DH_d = [0.200, 0, 0.4, 0, 0.39, 0, 0];
LBR4p_DH_a = [0, 0, 0, 0, 0, 0, 0];
LBR4p_DH_alpha = [pi/2, -pi/2, pi/2, -pi/2, pi/2, -pi/2, 0];
LBR4p_DH_type = double(repmat(DQ_JointType.REVOLUTE,1,7));
LBR4p_DH_matrix = [LBR4p_DH_theta;
                    LBR4p_DH_d;
                    LBR4p_DH_a;
                    LBR4p_DH_alpha
                    LBR4p_DH_type];

robot = DQ_SerialManipulatorDH(LBR4p_DH_matrix);
robot.set_effector(1+0.5*DQ.E*DQ.k*0.07);

can be replaced by a single call to LBR4pVrepRobot. Also, there is no need to do calls such as

vi.set_joint_target_velocities(jointnames, u);
q_dot(:,j) = vi.get_joint_velocities(jointnames);

because we have higher-level methods for those (e.g., set_configuration_space_positions, get_configuration_space_positions, etc).

Kind regards,
Frederico

@bvadorno
Copy link
Member

bvadorno commented Aug 7, 2024

Thanks, @ffasilva.

You must be careful with the functions set_joint_target_velocities. They imply that the example considers joint dynamics (there is an inner loop control). If my memory does not fail me, this is not the case for set_configuration_space_positions. @juanjqo, can you confirm?

Kind regards,
Bruno

@juanjqo
Copy link
Member

juanjqo commented Aug 7, 2024

Hi @bvadorno and @ffasilva

I completely forgot everything about the mentioned example and I had to review some previous discussions. I have some minor comments that I'd like to mention here for myself in the future.

  • This example (vrep/constrained_kinematic_control.m) was added to the official examples of the DQ robotics after a discussion started by a user who reported difficulties in using the DQ Robotics with CoppeliaSim. If I'm not mistaken, I decided in the discussion to provide a minimal example explicitly using the model definition, since the user was using the wrong model. Furthermore, at that time, there was an issue related to the class LBR4pVrepRobot (fixed in pull89).
  • @bvadorno indeed, the constrained_kinematic_control.m example considers both the dynamics engine and the synchronous mode enabled, and joint velocities as control inputs, and consequently, this is not the case for set_configuration_space_positions but set_target_configuration_space_velocities.

@juanjqo
Copy link
Member

juanjqo commented Aug 7, 2024

@bvadorno @ffasilva may I update the example?

@ffasilva
Copy link
Member Author

ffasilva commented Aug 7, 2024

Hi @juanjqo,

I would do it latter this week, but if you have the time now, go for it! I can then review it, if @bvadorno is okay with it.

Kind regards,
Frederico

@bvadorno
Copy link
Member

bvadorno commented Aug 7, 2024

Dear @ffasilva and @juanjq,

Not yet. I’ll schedule a DQ Robotics meeting for this Friday, and I’ll use this particular example to illustrate how the current development flow needs to be amended.

Kind regards,
Bruno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants