Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
RobotAPI
Commits
b5538c0c
Commit
b5538c0c
authored
10 years ago
by
Mirko Waechter
Browse files
Options
Downloads
Patches
Plain Diff
Hopefully fixed #1310
parent
c2cda902
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/motioncontrol/MotionControl.cpp
+11
-14
11 additions, 14 deletions
source/RobotAPI/motioncontrol/MotionControl.cpp
source/RobotAPI/motioncontrol/MotionControl.h
+1
-0
1 addition, 0 deletions
source/RobotAPI/motioncontrol/MotionControl.h
with
12 additions
and
14 deletions
source/RobotAPI/motioncontrol/MotionControl.cpp
+
11
−
14
View file @
b5538c0c
...
...
@@ -324,6 +324,11 @@ void MoveTCPTrajectory::onEnter()
throw
armarx
::
exceptions
::
local
::
eStatechartLogicError
(
"the number of targetTCPPositions does not equal the number of targetTCPOrientations"
);
sendEvent
<
EvFailure
>
();
}
// create a counter to keep track of the poses that were already reached. As we dont use the event, set the max to n+1 so it will never be sent
ARMARX_INFO
<<
"number of points on trajectory: "
<<
numberOfPoints
;
trajectoryPointCounterID
=
setCounterEvent
(
numberOfPoints
,
createEvent
<
EvSuccess
>
());
setLocal
(
"trajectoryPointCounterID"
,
Variant
(
trajectoryPointCounterID
.
actionId
));
}
...
...
@@ -331,9 +336,7 @@ void MoveTCPTrajectory::onEnter()
void
MoveTCPTrajectory
::
onExit
()
{
removeTimeoutEvent
(
timeoutEvent
);
ChannelRefPtr
r
=
getLocal
<
ChannelRef
>
(
"trajectoryPointCounterID"
);
getContext
()
->
systemObserverPrx
->
removeCounter
(
r
);
//removeCounterEvent(trajectoryPointCounterID);
removeCounterEvent
(
trajectoryPointCounterID
);
}
...
...
@@ -359,8 +362,8 @@ void MoveTCPTrajectory::defineSubstates()
void
MoveTCPTrajectoryInit
::
defineParameters
()
{
addToInput
(
"targetTCPPositions"
,
VariantType
::
List
(
VariantType
::
FramedPosition
),
false
);
addToOutput
(
"trajectoryPointCounterID"
,
VariantType
::
ChannelRef
,
false
);
//
addToInput("targetTCPPositions", VariantType::List(VariantType::FramedPosition), false);
//
addToOutput("trajectoryPointCounterID", VariantType::ChannelRef, false);
}
...
...
@@ -368,11 +371,7 @@ void MoveTCPTrajectoryInit::defineParameters()
void
MoveTCPTrajectoryInit
::
onEnter
()
{
// create a counter to keep track of the poses that were already reached. As we dont use the event, set the max to n+1 so it will never be sent
int
numberOfPoints
=
getInput
<
SingleTypeVariantList
>
(
"targetTCPPositions"
)
->
getSize
();
ARMARX_INFO
<<
"number of points on trajectory: "
<<
numberOfPoints
;
ActionEventIdentifier
trajectoryPointCounterID
=
setCounterEvent
(
numberOfPoints
,
createEvent
<
EvLastPointReached
>
());
setOutput
(
"trajectoryPointCounterID"
,
trajectoryPointCounterID
.
actionId
.
get
());
sendEvent
<
EvSuccess
>
();
}
...
...
@@ -384,7 +383,7 @@ void MoveTCPTrajectoryCheckCounter::defineParameters()
{
addToInput
(
"targetTCPPositions"
,
VariantType
::
List
(
VariantType
::
FramedPosition
),
false
);
addToInput
(
"trajectoryPointCounterID"
,
VariantType
::
ChannelRef
,
false
);
addToOutput
(
"trajectoryPointCounterID"
,
VariantType
::
ChannelRef
,
false
);
}
...
...
@@ -394,7 +393,6 @@ void MoveTCPTrajectoryCheckCounter::onEnter()
{
context
=
getContext
<
RobotStatechartContext
>
();
ChannelRefPtr
trajectoryPointCounterID
=
getInput
<
ChannelRef
>
(
"trajectoryPointCounterID"
);
setOutput
(
"trajectoryPointCounterID"
,
trajectoryPointCounterID
);
int
counterValue
=
trajectoryPointCounterID
->
getDataField
(
"value"
)
->
getInt
();
...
...
@@ -427,7 +425,6 @@ void MoveTCPTrajectoryNextPoint::defineParameters()
addToInput
(
"timeoutInMs"
,
VariantType
::
Int
,
false
);
addToInput
(
"trajectoryPointCounterID"
,
VariantType
::
ChannelRef
,
false
);
addToOutput
(
"trajectoryPointCounterID"
,
VariantType
::
ChannelRef
,
false
);
addToLocal
(
"targetTCPPosition"
,
VariantType
::
FramedPosition
);
...
...
@@ -444,7 +441,6 @@ void MoveTCPTrajectoryNextPoint::onEnter()
{
context
=
getContext
<
RobotStatechartContext
>
();
ChannelRefPtr
trajectoryPointCounterID
=
getInput
<
ChannelRef
>
(
"trajectoryPointCounterID"
);
setOutput
(
"trajectoryPointCounterID"
,
trajectoryPointCounterID
);
int
counterValue
=
trajectoryPointCounterID
->
getDataField
(
"value"
)
->
getInt
();
...
...
@@ -452,6 +448,7 @@ void MoveTCPTrajectoryNextPoint::onEnter()
setLocal
(
"targetTCPOrientation"
,
*
VariantPtr
::
dynamicCast
(
getInput
<
SingleTypeVariantList
>
(
"targetTCPOrientations"
)
->
getVariant
(
counterValue
)));
context
->
systemObserverPrx
->
incrementCounter
(
trajectoryPointCounterID
);
}
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/motioncontrol/MotionControl.h
+
1
−
0
View file @
b5538c0c
...
...
@@ -202,6 +202,7 @@ namespace MotionControl
RobotStatechartContext
*
context
;
ConditionIdentifier
lastTargetReachedCondition
;
ActionEventIdentifier
timeoutEvent
;
ActionEventIdentifier
trajectoryPointCounterID
;
void
defineParameters
();
void
defineSubstates
();
void
onEnter
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment