Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Manipulation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
Skills
Manipulation
Commits
d4d24f76
Commit
d4d24f76
authored
2 years ago
by
Your Name
Browse files
Options
Downloads
Patches
Plain Diff
Robot: getToFInHand
parent
026baf0e
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/armarx/manipulation/core/Robot.cpp
+35
-0
35 additions, 0 deletions
source/armarx/manipulation/core/Robot.cpp
source/armarx/manipulation/core/Robot.h
+4
-0
4 additions, 0 deletions
source/armarx/manipulation/core/Robot.h
with
39 additions
and
0 deletions
source/armarx/manipulation/core/Robot.cpp
+
35
−
0
View file @
d4d24f76
...
...
@@ -21,6 +21,7 @@
#include
"Robot.h"
#include
"ArmarXCore/core/exceptions/local/ExpressionException.h"
#include
"RobotAPI/libraries/armem_robot/types.h"
namespace
armarx
::
manipulation
::
core
{
...
...
@@ -89,6 +90,40 @@ namespace armarx::manipulation::core
};
}
std
::
optional
<
armem
::
robot
::
ToFArray
>
Robot
::
getToFInHand
(
const
Hand
hand
,
const
armarx
::
core
::
time
::
DateTime
&
timestamp
)
{
const
armem
::
robot
::
RobotDescription
desc
{.
name
=
robotName
};
const
auto
tof
=
robotReader
.
queryToF
(
desc
,
timestamp
);
if
(
not
tof
.
has_value
())
{
return
std
::
nullopt
;
}
armem
::
robot
::
ToFArray
tofArray
;
std
::
string
frame
;
switch
(
hand
)
{
case
Hand
::
Left
:
ARMARX_CHECK
(
tof
->
count
(
armem
::
robot_state
::
RobotReader
::
Hand
::
Left
)
>
0
);
tofArray
=
tof
->
at
(
armem
::
robot_state
::
RobotReader
::
Hand
::
Left
);
frame
=
"TimeOfFlightLeft"
;
// frame = leftArmHelper.getTimeOfFlightSensorFrame();
break
;
case
Hand
::
Right
:
ARMARX_CHECK
(
tof
->
count
(
armem
::
robot_state
::
RobotReader
::
Hand
::
Right
)
>
0
);
tofArray
=
tof
->
at
(
armem
::
robot_state
::
RobotReader
::
Hand
::
Right
);
frame
=
"TimeOfFlightRight"
;
// frame = rightArmHelper.getTimeOfFlightSensorFrame();
break
;
}
return
tofArray
;
}
RobotUnitInterfacePrx
Robot
::
robotUnit
()
const
...
...
This diff is collapsed.
Click to expand it.
source/armarx/manipulation/core/Robot.h
+
4
−
0
View file @
d4d24f76
...
...
@@ -37,6 +37,7 @@
#include
"RobotAPI/libraries/RobotStatechartHelpers/RobotNameHelper.h"
#include
"RobotAPI/libraries/armem/client/MemoryNameSystem.h"
#include
"RobotAPI/libraries/armem/core/Time.h"
#include
"RobotAPI/libraries/armem_robot/types.h"
#include
"RobotAPI/libraries/armem_robot_state/client/common/VirtualRobotReader.h"
#include
"RobotAPI/libraries/core/FramedPose.h"
...
...
@@ -82,6 +83,9 @@ namespace armarx::manipulation::core
std
::
optional
<
ForceTorque
>
getForceTorqueInHand
(
Hand
hand
,
const
armarx
::
DateTime
&
timestamp
=
armarx
::
Clock
::
Now
());
std
::
optional
<
armem
::
robot
::
ToFArray
>
getToFInHand
(
Hand
hand
,
const
armarx
::
DateTime
&
timestamp
=
armarx
::
Clock
::
Now
());
armarx
::
RobotUnitInterfacePrx
robotUnit
()
const
;
armarx
::
HandUnitInterfacePrx
handUnit
(
Hand
hand
)
const
;
...
...
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