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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
&ACCESS R
DEFDAT rsi_joint_pos PUBLIC
CONST CHAR CONTEXT_NAME[64]
CONTEXT_NAME[] = "rsi_joint_pos"
ENDDAT
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ DEF rsi_joint_pos()
PTP $AXIS_ACT_MEAS

; Create RSI Context
ret = RSI_LOAD("rsi_joint_pos")
ret = RSI_LOAD(CONTEXT_NAME)
IF (ret <> RSIOK) THEN
HALT
ENDIF

; Set AxisCorr parameters to allow full range of motion
ROS_SetAxisCorrLimits("rsi_joint_pos")
ROS_SetAxisCorrLimits(CONTEXT_NAME)

; Activate RSI Context
ret = RSI_ACTIVATE("rsi_joint_pos")
ret = RSI_ACTIVATE(CONTEXT_NAME)
IF (ret <> RSIOK) THEN
HALT
ENDIF
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not change! The content of this file is generated. -->
<!-- Generated with RSIVisual iiQWorks.AppBuilder plugin. -->
<!-- iiQKA.RobotSensorInterface 6.1.2.4 -->
<!-- iiQKA.RobotSensorInterface 6.2.0.11 -->
<RsiContext xsi:schemaLocation="RsiContext RsiContext.xsd" SchemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="RsiContext">
<RsiObjects xmlns="RsiDriver">
<RsiObject ObjTypeId="64" ObjType="Ethernet" ObjId="ETHERNET1">
<Inputs>
<Input InIdx="0" OutObjId="AxisActExt_1" OutIdx="0" SignalName="AxisActExt_1|E1" />
<Input InIdx="1" OutObjId="AxisActExt_1" OutIdx="1" SignalName="AxisActExt_1|E2" />
<Input InIdx="2" OutObjId="AxisActExt_1" OutIdx="2" SignalName="AxisActExt_1|E3" />
<Input InIdx="3" OutObjId="AxisActExt_1" OutIdx="3" SignalName="AxisActExt_1|E4" />
<Input InIdx="4" OutObjId="AxisActExt_1" OutIdx="4" SignalName="AxisActExt_1|E5" />
<Input InIdx="5" OutObjId="AxisActExt_1" OutIdx="5" SignalName="AxisActExt_1|E6" />
</Inputs>
<Parameters>
<Parameter IsRuntime="false" Name="ConfigFile" ParamId="0" ParamValue="rsi_ethernet.xml" />
<Parameter Name="Timeout" ParamId="0" ParamValue="100" />
Expand Down Expand Up @@ -61,6 +69,27 @@
<Parameter IsRuntime="false" Name="MaxE6" ParamId="11" ParamValue="6" />
</Parameters>
</RsiObject>
<RsiObject ObjTypeId="87" ObjType="AxisCorrExt" ObjId="AxisCorrExt_1">
<Parameters>
<Parameter Name="LowerLimE1" ParamId="0" ParamValue="-5" />
<Parameter Name="LowerLimE2" ParamId="1" ParamValue="-5" />
<Parameter Name="LowerLimE3" ParamId="2" ParamValue="-5" />
<Parameter Name="LowerLimE4" ParamId="3" ParamValue="-5" />
<Parameter Name="LowerLimE5" ParamId="4" ParamValue="-5" />
<Parameter Name="LowerLimE6" ParamId="5" ParamValue="-5" />
<Parameter Name="UpperLimE1" ParamId="6" ParamValue="5" />
<Parameter Name="UpperLimE2" ParamId="7" ParamValue="5" />
<Parameter Name="UpperLimE3" ParamId="8" ParamValue="5" />
<Parameter Name="UpperLimE4" ParamId="9" ParamValue="5" />
<Parameter Name="UpperLimE5" ParamId="10" ParamValue="5" />
<Parameter Name="UpperLimE6" ParamId="11" ParamValue="5" />
</Parameters>
</RsiObject>
<RsiObject ObjTypeId="90" ObjType="AxisActExt" ObjId="AxisActExt_1">
<Parameters>
<Parameter Name="Type" ParamId="0" ParamValue="0" />
</Parameters>
</RsiObject>
</RsiObjects>
<BlueprintCollections SchemaVersion="2.0.0" xmlns="RsiBlueprint">
<BlueprintCollection Name="RSI" Version="3.1.0">
Expand Down Expand Up @@ -2479,26 +2508,34 @@
</BlueprintCollections>
<Constructs xmlns="RsiConstruct">
<Construct Name="ETHERNET1" BlueprintName="Ethernet" BlueprintCollection="RSI" Location="0,0">
<Inputs>
<Input Name="In1" SourceObject="AxisActExt_1" SourcePort="E1" Points="-244.63333333333333,23.96;-196.63333333333333,23.96;-148.63333333333333,23.96;-148.63333333333333,23.96;-34,23.96;-18,23.96" />
<Input Name="In2" SourceObject="AxisActExt_1" SourcePort="E2" Points="-244.63333333333333,53.96;-204.63333333333333,53.96;-164.63333333333333,53.96;-164.63333333333333,53.96;-34,53.96;-18,53.96" />
<Input Name="In3" SourceObject="AxisActExt_1" SourcePort="E3" Points="-244.63333333333333,83.960000000000008;-212.63333333333333,83.960000000000008;-180.63333333333333,83.960000000000008;-180.63333333333333,83.960000000000008;-34,83.960000000000008;-18,83.960000000000008" />
<Input Name="In4" SourceObject="AxisActExt_1" SourcePort="E4" Points="-244.63333333333333,113.96000000000001;-220.63333333333333,113.96000000000001;-196.63333333333333,113.96000000000001;-196.63333333333333,113.96000000000001;-34,113.96000000000001;-18,113.96000000000001" />
<Input Name="In5" SourceObject="AxisActExt_1" SourcePort="E5" Points="-244.63333333333333,143.96;-228.63333333333333,143.96;-212.63333333333333,143.96;-212.63333333333333,143.96;-34,143.96;-18,143.96" />
<Input Name="In6" SourceObject="AxisActExt_1" SourcePort="E6" Points="-244.63333333333333,173.96;-236.63333333333333,173.96;-228.63333333333333,173.96;-228.63333333333333,173.96;-34,173.96;-18,173.96" />
</Inputs>
<Parameters>
<StringParameter Name="ConfigFile" Value="rsi_ethernet.xml" />
<IntParameter Name="Timeout" Value="100" />
<IntParameter Name="Flag" Value="1" />
<IntParameter Name="Precision" Value="4" />
</Parameters>
</Construct>
<Construct Name="Stop_1" BlueprintName="Stop" BlueprintCollection="RSI" Location="400,383.52">
<Construct Name="Stop_1" BlueprintName="Stop" BlueprintCollection="RSI" Location="402,384">
<Inputs>
<Input Name="In1" SourceObject="ETHERNET1" SourcePort="Out7" Points="181.93,203.96;189.93,203.96;197.93,203.96;197.93,407.48;366,407.48;382,407.48" />
<Input Name="In1" SourceObject="ETHERNET1" SourcePort="Out7" Points="181.93,203.96;197.93,203.96;213.93,203.96;213.93,407.96;368,407.96;384,407.96" />
</Inputs>
</Construct>
<Construct Name="AxisCorr_1" BlueprintName="AxisCorr" BlueprintCollection="RSI" Location="402,0">
<Inputs>
<Input Name="CorrA1" SourceObject="ETHERNET1" SourcePort="Out1" Points="181.93,23.96;237.93,23.96;293.93,23.96;293.93,23.96;368,23.96;384,23.96" />
<Input Name="CorrA2" SourceObject="ETHERNET1" SourcePort="Out2" Points="181.93,53.96;229.93,53.96;277.93,53.96;277.93,53.96;368,53.96;384,53.96" />
<Input Name="CorrA3" SourceObject="ETHERNET1" SourcePort="Out3" Points="181.93,83.96;221.93,83.96;261.93,83.96;261.93,83.96;368,83.96;384,83.96" />
<Input Name="CorrA4" SourceObject="ETHERNET1" SourcePort="Out4" Points="181.93,113.96;213.93,113.96;245.93,113.96;245.93,113.96;368,113.96;384,113.96" />
<Input Name="CorrA5" SourceObject="ETHERNET1" SourcePort="Out5" Points="181.93,143.96;205.93,143.96;229.93,143.96;229.93,143.96;368,143.96;384,143.96" />
<Input Name="CorrA6" SourceObject="ETHERNET1" SourcePort="Out6" Points="181.93,173.96;197.93,173.96;213.93,173.96;213.93,173.96;368,173.96;384,173.96" />
<Input Name="CorrA1" SourceObject="ETHERNET1" SourcePort="Out1" Points="181.93,23.96;245.93,23.96;309.93,23.96;309.93,23.96;368,23.96;384,23.96" />
<Input Name="CorrA2" SourceObject="ETHERNET1" SourcePort="Out2" Points="181.93,53.96;237.93,53.96;293.93,53.96;293.93,53.96;368,53.96;384,53.96" />
<Input Name="CorrA3" SourceObject="ETHERNET1" SourcePort="Out3" Points="181.93,83.960000000000008;229.93,83.960000000000008;277.93,83.960000000000008;277.93,83.960000000000008;368,83.960000000000008;384,83.960000000000008" />
<Input Name="CorrA4" SourceObject="ETHERNET1" SourcePort="Out4" Points="181.93,113.96000000000001;221.93,113.96000000000001;261.93,113.96000000000001;261.93,113.96000000000001;368,113.96000000000001;384,113.96000000000001" />
<Input Name="CorrA5" SourceObject="ETHERNET1" SourcePort="Out5" Points="181.93,143.96;213.93,143.96;245.93,143.96;245.93,143.96;368,143.96;384,143.96" />
<Input Name="CorrA6" SourceObject="ETHERNET1" SourcePort="Out6" Points="181.93,173.96;205.93,173.96;229.93,173.96;229.93,173.96;368,173.96;384,173.96" />
</Inputs>
<Parameters>
<DoubleParameter Name="LowerLimA1" CanBeSetFromKrl="true" Value="-180" />
Expand All @@ -2515,7 +2552,7 @@
<DoubleParameter Name="UpperLimA6" CanBeSetFromKrl="true" Value="180" />
</Parameters>
</Construct>
<Construct Name="AxisCorrMon_1" BlueprintName="AxisCorrMon" BlueprintCollection="RSI" Location="12,252">
<Construct Name="AxisCorrMon_1" BlueprintName="AxisCorrMon" BlueprintCollection="RSI" Location="6,438">
<Parameters>
<DoubleParameter Name="MaxA1" Value="1000" />
<DoubleParameter Name="MaxA2" Value="1000" />
Expand All @@ -2525,5 +2562,7 @@
<DoubleParameter Name="MaxA6" Value="1000" />
</Parameters>
</Construct>
<Construct Name="AxisCorrExt_1" BlueprintName="AxisCorrExt" BlueprintCollection="RSI" Location="678,546" />
<Construct Name="AxisActExt_1" BlueprintName="AxisActExt" BlueprintCollection="RSI" Location="-426,0" />
</Constructs>
</RsiContext>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
<ELEMENT TAG="DEF_RIst" TYPE="DOUBLE" INDX="INTERNAL" />
<ELEMENT TAG="DEF_AIPos" TYPE="DOUBLE" INDX="INTERNAL" />
<ELEMENT TAG="DEF_Delay" TYPE="LONG" INDX="INTERNAL" />
</ELEMENTS>
<ELEMENT TAG="EXT.E1" TYPE="DOUBLE" INDX="1" />
<ELEMENT TAG="EXT.E2" TYPE="DOUBLE" INDX="2" />
<ELEMENT TAG="EXT.E3" TYPE="DOUBLE" INDX="3" />
<ELEMENT TAG="EXT.E4" TYPE="DOUBLE" INDX="4" />
<ELEMENT TAG="EXT.E5" TYPE="DOUBLE" INDX="5" />
<ELEMENT TAG="EXT.E6" TYPE="DOUBLE" INDX="6" />
</ELEMENTS>
</SEND>
<RECEIVE>
<ELEMENTS>
Expand All @@ -21,6 +27,12 @@
<ELEMENT TAG="AK.A5" TYPE="DOUBLE" INDX="5" HOLDON="1" />
<ELEMENT TAG="AK.A6" TYPE="DOUBLE" INDX="6" HOLDON="1" />
<ELEMENT TAG="Stop" TYPE="BOOL" INDX="7" HOLDON="0" />
<ELEMENT TAG="EK.E1" TYPE="DOUBLE" INDX="8" HOLDON="1" />
<ELEMENT TAG="EK.E2" TYPE="DOUBLE" INDX="9" HOLDON="1" />
<ELEMENT TAG="EK.E3" TYPE="DOUBLE" INDX="10" HOLDON="1" />
<ELEMENT TAG="EK.E4" TYPE="DOUBLE" INDX="11" HOLDON="1" />
<ELEMENT TAG="EK.E5" TYPE="DOUBLE" INDX="12" HOLDON="1" />
<ELEMENT TAG="EK.E6" TYPE="DOUBLE" INDX="13" HOLDON="1" />
</ELEMENTS>
</RECEIVE>
</ROOT>
19 changes: 18 additions & 1 deletion kuka_external_control_sdk/kss/include/kuka/external-control-sdk/kss/message_builder.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class MotionState : public BaseMotionState {
const std::string kAttributeSuffix = "\"/>";

const std::string kJointPositionsPrefix = "<AIPos";
const std::string kExtJointPositionsPrefix = "<EXT";

const std::string kDelayNodePrefix = "<Delay D=\"";
const std::string kGpioPrefix = "<GPIO";
Expand All @@ -77,6 +78,10 @@ class MotionState : public BaseMotionState {
long ipoc_ = 0;
long delay_ = 0;

static constexpr short kFixSixAxes = 6;
// TODO (kovacsge11) make configurable when SCARA support added
std::size_t num_of_non_ext_axes_ = 6;

static constexpr int kPrecision = 6;
};

Expand All @@ -96,10 +101,15 @@ class ControlSignal : public BaseControlSignal {
gpioAttributePrefix.push_back(" " + config.name + "=\"");
}

for (int i = 1; i <= dof; ++i) {
// Fixed all 6 non-ext and 6 ext positions sent, initial values for those not configured
for (int i = 1; i <= kFixSixAxes; ++i) {
joint_position_attribute_prefixes_.push_back(" A" + std::to_string(i) +
"=\"");
}
for (int i = 1; i <= kFixSixAxes; ++i) {
ext_joint_position_attribute_prefixes_.push_back(" E" + std::to_string(i) +
"=\"");
}
}
ControlSignal(const ControlSignal &other) = default;
ControlSignal &operator=(const ControlSignal &other) = delete;
Expand All @@ -116,13 +126,16 @@ class ControlSignal : public BaseControlSignal {
void AppendToXMLString(std::string_view str);

const std::string kMessagePrefix = "<Sen Type=\"KROSHU\">";

const std::string kJointPositionsPrefix = "<AK";
std::vector<std::string> joint_position_attribute_prefixes_;
const std::string kDoubleAttributeFormat =
"%." + std::to_string(kPrecision) + "f";
const std::string kAttributeSuffix = "/>";
const std::string kStopNodePrefix = "<Stop>";
const std::string kStopNodeSuffix = "</Stop>";
const std::string kExtJointPositionsPrefix = "<EK";
std::vector<std::string> ext_joint_position_attribute_prefixes_;
const std::string kGpioPrefix = "<GPIO";
const std::string kIpocNodePrefix = "<IPOC>";
const std::string kIpocNodeSuffix = "</IPOC>";
Expand All @@ -136,6 +149,10 @@ class ControlSignal : public BaseControlSignal {
static constexpr int kPrecision = 6;
static constexpr int kBufferSize = 1024;
char xml_string_[kBufferSize];

static constexpr short kFixSixAxes = 6;
// TODO (kovacsge11) make configurable when SCARA support added
std::size_t num_of_non_ext_axes_ = 6;
};
} // namespace kuka::external::control::kss

Expand Down
Loading
Loading