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
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
e2e6ab94
Commit
e2e6ab94
authored
4 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
ObjectPose: add updateAttached() (in-place)
parent
94d567d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!121
Resolve "ObjectPoseObserver: Refactor housekeeping tasks"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/libraries/ArmarXObjects/ObjectPose.cpp
+16
-11
16 additions, 11 deletions
source/RobotAPI/libraries/ArmarXObjects/ObjectPose.cpp
source/RobotAPI/libraries/ArmarXObjects/ObjectPose.h
+11
-2
11 additions, 2 deletions
source/RobotAPI/libraries/ArmarXObjects/ObjectPose.h
with
27 additions
and
13 deletions
source/RobotAPI/libraries/ArmarXObjects/ObjectPose.cpp
+
16
−
11
View file @
e2e6ab94
...
...
@@ -119,30 +119,35 @@ namespace armarx::objpose
return
std
::
nullopt
;
}
objpose
::
ObjectPose
ObjectPose
::
getAttached
(
VirtualRobot
::
RobotPtr
agent
)
objpose
::
ObjectPose
ObjectPose
::
getAttached
(
VirtualRobot
::
RobotPtr
agent
)
const
{
ARMARX_CHECK
(
attachment
);
objpose
::
ObjectPose
updated
=
*
this
;
const
objpose
::
ObjectAttachmentInfo
&
attachment
=
*
updated
.
attachment
;
updated
.
updateAttached
(
agent
);
return
updated
;
}
void
ObjectPose
::
updateAttached
(
VirtualRobot
::
RobotPtr
agent
)
{
ARMARX_CHECK
(
attachment
);
ARMARX_CHECK_EQUAL
(
attachment
.
agentName
,
agent
->
getName
());
ARMARX_CHECK_EQUAL
(
attachment
->
agentName
,
agent
->
getName
());
VirtualRobot
::
RobotNodePtr
robotNode
=
agent
->
getRobotNode
(
attachment
.
frameName
);
VirtualRobot
::
RobotNodePtr
robotNode
=
agent
->
getRobotNode
(
attachment
->
frameName
);
ARMARX_CHECK_NOT_NULL
(
robotNode
);
// Overwrite object pose
updated
.
objectPoseRobot
=
robotNode
->
getPoseInRootFrame
()
*
attachment
.
poseInFrame
;
updated
.
objectPoseGlobal
=
agent
->
getGlobalPose
()
*
updated
.
objectPoseRobot
;
objectPoseRobot
=
robotNode
->
getPoseInRootFrame
()
*
attachment
->
poseInFrame
;
objectPoseGlobal
=
agent
->
getGlobalPose
()
*
objectPoseRobot
;
updated
.
robotPose
=
agent
->
getGlobalPose
();
updated
.
robotConfig
=
agent
->
getConfig
()
->
getRobotNodeJointValueMap
();
return
updated
;
// Overwrite robot config.
robotPose
=
agent
->
getGlobalPose
();
robotConfig
=
agent
->
getConfig
()
->
getRobotNodeJointValueMap
();
}
}
namespace
armarx
{
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/ArmarXObjects/ObjectPose.h
+
11
−
2
View file @
e2e6ab94
...
...
@@ -74,8 +74,17 @@ namespace armarx::objpose
/// Get the OOBB in the global frame (according to `objectPoseGlobal`).
std
::
optional
<
simox
::
OrientedBoxf
>
oobbGlobal
()
const
;
/// Get `*this` with applied attachment.
objpose
::
ObjectPose
getAttached
(
VirtualRobot
::
RobotPtr
agent
);
/**
* @brief Get a copy of `*this` with updated attachment.
* @see `updateAttached()`
*/
objpose
::
ObjectPose
getAttached
(
VirtualRobot
::
RobotPtr
agent
)
const
;
/**
* @brief Update an the object pose and robot state of an attached
* object pose according to the given agent state (in-place).
* @param agent The agent/robot.
*/
void
updateAttached
(
VirtualRobot
::
RobotPtr
agent
);
};
using
ObjectPoseSeq
=
std
::
vector
<
ObjectPose
>
;
...
...
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