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

New abstract class DQ_CoppeliaSimInterface #112

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6589352
Added a draft of the new abstract class for coppeliasim
juanjqo Aug 16, 2024
f26060b
Added the DQ_CoppeliaSimInterface abstract class
juanjqo Aug 23, 2024
f545f8d
Merge branch 'dqrobotics:master' into new_interface
juanjqo Aug 23, 2024
de12e6f
Merge branch 'new_interface' of https://github.com/juanjqo/matlab int…
juanjqo Aug 23, 2024
4cbc4ac
[DQ_CoppeliaSimInterface.m] Fixed signature of stepping_mode method
juanjqo Aug 23, 2024
29e3aac
[DQ_VrepInterface] The class now a concrete class of the abstract cla…
juanjqo Aug 23, 2024
24b40ca
Added the new class DQ_CoppeliaSimLegacyInterface
juanjqo Aug 23, 2024
45e35b6
[DQ_VrepInterface] renamed the class to DQ_CoppeliaSimLegacyInterface…
juanjqo Aug 23, 2024
9fc718d
Added a new folder to organize better the new classes that use Coppel…
juanjqo Aug 27, 2024
47918cb
Added a new folder to organize better the new classes that use Coppel…
juanjqo Aug 27, 2024
53c21da
[DQ_VrepInterface] Added a deprecation warning, as suggested by Frede…
juanjqo Sep 13, 2024
718a9cb
[DQ_VrepRobot, DQ_CoppeliaSimRobot] Renamed the class and added backw…
juanjqo Sep 13, 2024
fd2aa4e
[DQ_SerialVrepRobot] fixed the constructor signature.
juanjqo Sep 13, 2024
e457e12
renamed the class DQ_SerialVrepRobot to DQ_SerialCoppeliaSimRobot.
juanjqo Sep 13, 2024
417b075
[DQ_SerialCoppeliaSimRobot] Updated the contributions.
juanjqo Sep 13, 2024
2d7ba87
Renamed the robots based on Vrep to use CoppeliaSim. Added backward c…
juanjqo Sep 13, 2024
c1e8d16
[YouBotVrepRobot.m] Added a deprecation warning message.
juanjqo Oct 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions interfaces/coppeliasim/DQ_CoppeliaSimInterface.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
% (C) Copyright 2024 DQ Robotics Developers
%
% This file is part of DQ Robotics.
%
% DQ Robotics is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% DQ Robotics is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Lesser General Public License
% along with DQ Robotics. If not, see <http://www.gnu.org/licenses/>.
%
% DQ Robotics website: dqrobotics.github.io
%
% Contributors to this file:
%
% 1. Juan Jose Quiroz Omana (juanjose.quirozomana@manchester.ac.uk)
% - Responsible for the original implementation.

classdef (Abstract) DQ_CoppeliaSimInterface < handle

properties (Access = protected)
end

methods (Access = protected)
% function obj = DQ_CoppeliaSim(inputArg1,inputArg2)
% end
end

methods(Abstract)
% This method connects to CoppeliaSim.
% Calling this function is required before anything else can happen.
connect(obj, host, port, TIMEOUT_IN_MILISECONDS);

% This method enables or disables the stepped (synchronous) mode
% for the remote API server service that the client is connected to.
% Example:
% set_stepping_mode(true) % stepping mode enabled
% set_stepping_mode(false) % stepping mode disabled
set_stepping_mode(obj, flag);

% This method sends trigger signal to the CoppeliaSim scene,
% which performs a simulation step when the stepping mode is used.
trigger_next_simulation_step(obj);

% This method starts the CoppeliaSim simulation.
start_simulation(obj);

% This method stops the CoppeliaSim simulation.
stop_simulation(obj);

% This method gets the handles for a cell array of
% object names in the the CoppeliaSim scene.
handles = get_handles(obj,names);

% This method gets the handle for a given object in the CoppeliaSim scene.
handle = get_handle(obj,name);

% This method gets the translation of an object in the CoppeliaSim scene.
t = get_object_translation(obj,objectname);

% This method sets the translation of an object in the CoppeliaSim scene.
set_object_translation(obj,objectname,translation);

% This method gets the rotation of an object in the CoppeliaSim scene.
r = get_object_rotation(obj, objectname);

% This method sets the rotation of an object in the CoppeliaSim scene.
set_object_rotation(obj,objectname,rotation);

% This method gets the pose of an object in the CoppeliaSim scene.
x = get_object_pose(obj,objectname);

% This method sets the pose of an object in the CoppeliaSim scene.
set_object_pose(obj,objectname,pose);

% This method sets the joint positions of a robot in the CoppeliaSim scene.
set_joint_positions(obj,jointnames,joint_positions);

% This method sets the joint positions of a robot in the CoppeliaSim scene.
joint_positions = get_joint_positions(obj,jointnames);

% This method sets the joint target positions of a robot in the CoppeliaSim scene.
% It is required a dynamics enabled scene, and joints in dynamic mode
% with position control mode.
% information about joint modes:
% https://www.coppeliarobotics.com/helpFiles/en/jointModes.htm
set_joint_target_positions(obj,jointnames,joint_target_positions);

% This method gets the joint velocities of a robot in the CoppeliaSim scene.
joint_velocities = get_joint_velocities(obj,jointnames);

% This method sets the joint target velocities of a robot in the CoppeliaSim scene.
% It is required a dynamics enabled scene, and joints in dynamic mode
% with velocity control mode. Check this link for more
% information about joint modes:
% https://www.coppeliarobotics.com/helpFiles/en/jointModes.htm
set_joint_target_velocities(obj,jointnames,joint_target_velocities);

% This method sets the joint torques of a robot in the CoppeliaSim scene.
% It is required a dynamics enabled scene, and joints in dynamic mode
% with velocity or force/torque control mode. Check this link for more
% information about joint modes:
% https://www.coppeliarobotics.com/helpFiles/en/jointModes.htm
set_joint_torques(obj,jointnames,torques);

% This method gets the joint torques of a robot in the CoppeliaSim scene.
joint_torques = get_joint_torques(obj,jointnames);
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to add the methods get_center_of_mass(), get_mass(), and get_inertia_matrix().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ffasilva, thank you for the reminder.

Note for the future Juancho (since I am going to completely forget this): we discussed this internally. We decided to add those methods in a future PR since they are not available in the master version of the DQ Robotics. We are still working on it at #109

end


Loading