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

Update RAPID modules #12

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions abb_hardware_interface/src/abb_system_position_only.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ CallbackReturn ABBSystemPositionOnlyHardware::on_activate(const rclcpp_lifecycle

return_type ABBSystemPositionOnlyHardware::read()
{
if (!egm_manager_->read(motion_data_)) {
RCLCPP_INFO(LOGGER, "Failed to read EGM feedback - is EGM session active?");
}
egm_manager_->read(motion_data_);
return return_type::OK;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
<plugin>abb_hardware_interface/ABBSystemPositionOnlyHardware</plugin>
<param name="rws_port">80</param>
<param name="rws_ip">${robotstudio_ip}</param>
<param name="rob1egm_port">6511</param>
<!-- The following parameter is used for the non-MultiMove only -->
<param name="egm_port">6511</param>
<!-- The following parameters are used for the MultiMove example only -->
<!-- <param name="rob1egm_port">6511</param> -->
<!-- <param name="extaxegm_port">6512</param> -->
</xacro:unless>
</hardware>
<joint name="${prefix}joint_1">
Expand Down
Binary file modified robot_studio_resources/IRB1200_5_90.rspag
Binary file not shown.
Binary file modified robot_studio_resources/IRB1200_5_90_EXTAX.rspag
Binary file not shown.
37 changes: 18 additions & 19 deletions robot_studio_resources/TExtAxisMain.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ MODULE TExtAxisMain
!
! Procedure main
!
! This RAPID code exemplify how to run EGM joint position
! motions.
! This RAPID code exemplifies how to run EGM motions with an
! external axis. It can be started in parallel with a task
! that runs EGM motions with a robot.
!
! Note: Update the UCDevice "EXTAX" with correct
! values for the remote address and port
Expand All @@ -61,25 +62,23 @@ MODULE TExtAxisMain
!
!***********************************************************
PROC main()
WHILE TRUE DO
! Register an EGM id.
EGMGetId egm_id;
! Setup the EGM communication.
EGMSetupUC MU_250__01, egm_id, "default", "EXTAX", \Joint;
! Prepare for an EGM communication session.
EGMActJoint egm_id;


! Register an EGM id.
stephanie-eng marked this conversation as resolved.
Show resolved Hide resolved
EGMGetId egm_id;

! Setup the EGM communication.
EGMSetupUC MU_250__01, egm_id, "default", "EXTAX", \Joint;

! Prepare for an EGM communication session.
EGMActJoint egm_id;

WHILE TRUE DO
! Start the EGM communication session.
EGMRunJoint egm_id, EGM_STOP_HOLD;

! Release the EGM id.
EGMReset egm_id;

WaitTime 5;
ENDWHILE
ENDWHILE
! Release the EGM id.
EGMReset egm_id;


ERROR
IF ERRNO = ERR_UDPUC_COMM THEN
Expand Down
192 changes: 95 additions & 97 deletions robot_studio_resources/TRob1Main.mod
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,98 +1,96 @@
MODULE TRob1Main
!======================================================================================================
! Copyright (c) 2018, ABB Schweiz AG
! All rights reserved.
!
! Redistribution and use in source and binary forms, with
! or without modification, are permitted provided that
! the following conditions are met:
!
! * Redistributions of source code must retain the
! above copyright notice, this list of conditions
! and the following disclaimer.
! * Redistributions in binary form must reproduce the
! above copyright notice, this list of conditions
! and the following disclaimer in the documentation
! and/or other materials provided with the
! distribution.
! * Neither the name of ABB nor the names of its
! contributors may be used to endorse or promote
! products derived from this software without
! specific prior wrSitten permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
! SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
! THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!======================================================================================================

!***********************************************************
! Program data
!***********************************************************
! Home position.
LOCAL CONST jointtarget home := [[0, 0, 0, 0, 30, 0], [9E9, 9E9, 9E9, 9E9, 9E9, 9E9]];

! Identifier for the EGM correction.
LOCAL VAR egmident egm_id;

! Limits for convergance.
LOCAL VAR egm_minmax egm_condition := [-0.1, 0.1];

!***********************************************************
!
! Procedure main
!
! This RAPID code exemplify how to run EGM joint position
! motions.
!
! Note: Update the UCDevice "ROB_1" with correct
! values for the remote address and port
! (i.e. to the EGM server).
!
! Update via RobotStudio:
! Controller tab -> Configuration ->
! Communication -> Transmission Protocol
!
!***********************************************************
PROC main()
MoveAbsJ home, v200, fine, tool0;
WHILE TRUE DO

! Register an EGM id.
EGMGetId egm_id;

! Setup the EGM communication.
EGMSetupUC ROB_1, egm_id, "default", "ROB_1", \Joint;

! Prepare for an EGM communication session.
EGMActJoint egm_id
\J1:=egm_condition
\J2:=egm_condition
\J3:=egm_condition
\J4:=egm_condition
\J5:=egm_condition
\J6:=egm_condition
\MaxSpeedDeviation:=20.0;

! Start the EGM communication session.
EGMRunJoint egm_id, EGM_STOP_RAMP_DOWN, \J1 \J2 \J3 \J4 \J5 \J6 \CondTime:=5 \RampOutTime:=5;

! Release the EGM id.
EGMReset egm_id;

WaitTime 5;
ENDWHILE

ERROR
IF ERRNO = ERR_UDPUC_COMM THEN
TPWrite "Communication timedout";
TRYNEXT;
ENDIF
ENDPROC
MODULE TRob1Main
!======================================================================================================
! Copyright (c) 2018, ABB Schweiz AG
! All rights reserved.
!
! Redistribution and use in source and binary forms, with
! or without modification, are permitted provided that
! the following conditions are met:
!
! * Redistributions of source code must retain the
! above copyright notice, this list of conditions
! and the following disclaimer.
! * Redistributions in binary form must reproduce the
! above copyright notice, this list of conditions
! and the following disclaimer in the documentation
! and/or other materials provided with the
! distribution.
! * Neither the name of ABB nor the names of its
! contributors may be used to endorse or promote
! products derived from this software without
! specific prior wrSitten permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
! SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
! THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!======================================================================================================

!***********************************************************
! Program data
!***********************************************************
! Home position.
LOCAL CONST jointtarget home := [[0, 0, 0, 0, 30, 0], [9E9, 9E9, 9E9, 9E9, 9E9, 9E9]];

! Identifier for the EGM correction.
LOCAL VAR egmident egm_id;

! Limits for convergance.
LOCAL VAR egm_minmax egm_condition := [-0.1, 0.1];

!***********************************************************
!
! Procedure main
!
! This RAPID code exemplify how to run EGM joint position
! motions.
!
! Note: Update the UCDevice "ROB_1" with correct
! values for the remote address and port
! (i.e. to the EGM server).
!
! Update via RobotStudio:
! Controller tab -> Configuration ->
! Communication -> Transmission Protocol
!
!***********************************************************
PROC main()
MoveAbsJ home, v200, fine, tool0;


! Register an EGM id.
EGMGetId egm_id;

! Setup the EGM communication.
EGMSetupUC ROB_1, egm_id, "default", "ROB_1", \Joint;

! Prepare for an EGM communication session.
EGMActJoint egm_id
\J1:=egm_condition
\J2:=egm_condition
\J3:=egm_condition
\J4:=egm_condition
\J5:=egm_condition
\J6:=egm_condition
\MaxSpeedDeviation:=20.0;
WHILE TRUE DO
! Start the EGM communication session.
EGMRunJoint egm_id, EGM_STOP_HOLD, \J1 \J2 \J3 \J4 \J5 \J6 \CondTime:=5 \RampOutTime:=5;
ENDWHILE
! Release the EGM id.
EGMReset egm_id;


ERROR
IF ERRNO = ERR_UDPUC_COMM THEN
TPWrite "Communication timedout";
TRYNEXT;
ENDIF
ENDPROC
ENDMODULE