Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Control
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
Control
Commits
7cc9b4a5
Commit
7cc9b4a5
authored
1 year ago
by
Patrick Dormanns
Browse files
Options
Downloads
Patches
Plain Diff
set logging tag
parent
6ea294ac
No related branches found
No related tags found
1 merge request
!53
Implement 'PointAt'-skill
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/armarx/control/pointing/core/Pointing.cpp
+19
-18
19 additions, 18 deletions
source/armarx/control/pointing/core/Pointing.cpp
source/armarx/control/pointing/core/Pointing.h
+4
-4
4 additions, 4 deletions
source/armarx/control/pointing/core/Pointing.h
with
23 additions
and
22 deletions
source/armarx/control/pointing/core/Pointing.cpp
+
19
−
18
View file @
7cc9b4a5
...
...
@@ -14,6 +14,7 @@ namespace armarx::control::pointing::core
{
Pointing
::
Pointing
(
const
Remote
&
remote
)
:
remote_
(
remote
)
{
setTag
(
"Pointing"
);
}
void
...
...
@@ -38,7 +39,7 @@ namespace armarx::control::pointing::core
if
(
params
.
handShape
)
{
auto
shapeJointValues
=
G
etShapeJointValues
(
robot
,
params
.
side
,
*
params
.
handShape
);
auto
shapeJointValues
=
g
etShapeJointValues
(
robot
,
params
.
side
,
*
params
.
handShape
);
addHandTrajectory
(
robot
,
traj
,
shapeJointValues
);
}
...
...
@@ -129,6 +130,23 @@ namespace armarx::control::pointing::core
});
}
std
::
map
<
std
::
string
,
float
>
Pointing
::
getShapeJointValues
(
VirtualRobot
::
RobotPtr
robot
,
Side
side
,
const
std
::
string
&
shapeName
)
{
auto
eefName
=
std
::
string
(
"Hand_"
)
+
(
side
==
Side
::
LEFT
?
"L"
:
"R"
)
+
"_EEF"
;
// TODO
auto
eef
=
robot
->
getEndEffector
(
eefName
);
auto
shape
=
eef
->
getPreshape
(
shapeName
);
if
(
not
shape
)
{
ARMARX_ERROR
<<
"Hand '"
<<
eefName
<<
"' has no shape '"
<<
shape
<<
"'"
;
throw
armarx
::
exceptions
::
local
::
PointingFailedException
();
}
return
shape
->
getRobotNodeJointValueMap
();
}
void
Pointing
::
addHandTrajectory
(
VirtualRobot
::
RobotPtr
robot
,
armarx
::
TrajectoryPtr
traj
,
...
...
@@ -167,21 +185,4 @@ namespace armarx::control::pointing::core
ARMARX_INFO
<<
"Pointing target reached"
;
}
std
::
map
<
std
::
string
,
float
>
Pointing
::
GetShapeJointValues
(
VirtualRobot
::
RobotPtr
robot
,
Side
side
,
const
std
::
string
&
shapeName
)
{
auto
eefName
=
std
::
string
(
"Hand_"
)
+
(
side
==
Side
::
LEFT
?
"L"
:
"R"
)
+
"_EEF"
;
// TODO
auto
eef
=
robot
->
getEndEffector
(
eefName
);
auto
shape
=
eef
->
getPreshape
(
shapeName
);
if
(
not
shape
)
{
ARMARX_ERROR
<<
"Hand '"
<<
eefName
<<
"' has no shape '"
<<
shape
<<
"'"
;
throw
armarx
::
exceptions
::
local
::
PointingFailedException
();
}
return
shape
->
getRobotNodeJointValueMap
();
}
}
// namespace armarx::control::pointing::core
This diff is collapsed.
Click to expand it.
source/armarx/control/pointing/core/Pointing.h
+
4
−
4
View file @
7cc9b4a5
...
...
@@ -36,7 +36,7 @@ namespace armarx::control::pointing::core
*
* @ingroup Library-pointing
*/
class
Pointing
class
Pointing
:
virtual
public
armarx
::
Logging
{
public:
struct
Remote
...
...
@@ -100,15 +100,15 @@ namespace armarx::control::pointing::core
void
addWristTrajectory
(
VirtualRobot
::
RobotPtr
robot
,
Side
side
,
armarx
::
TrajectoryPtr
traj
);
std
::
map
<
std
::
string
,
float
>
getShapeJointValues
(
VirtualRobot
::
RobotPtr
robot
,
Side
side
,
const
std
::
string
&
shapeName
);
void
addHandTrajectory
(
VirtualRobot
::
RobotPtr
robot
,
armarx
::
TrajectoryPtr
traj
,
const
std
::
map
<
std
::
string
,
float
>&
shapeJointValues
);
void
playTrajectory
(
armarx
::
TrajectoryPtr
traj
);
static
std
::
map
<
std
::
string
,
float
>
GetShapeJointValues
(
VirtualRobot
::
RobotPtr
robot
,
Side
side
,
const
std
::
string
&
shapeName
);
private
:
Remote
remote_
;
std
::
atomic_bool
aborted
;
...
...
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