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
Lennard Hofmann
RobotAPI
Commits
bbea214b
Commit
bbea214b
authored
10 years ago
by
Peter Kaiser
Browse files
Options
Downloads
Patches
Plain Diff
DebugDrawer: Adapted sphere drawing to new DebugDrawer
parent
ed75fea0
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/components/DebugDrawer/DebugDrawerComponent.cpp
+14
-9
14 additions, 9 deletions
.../RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h
+1
-0
1 addition, 0 deletions
...ce/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h
with
15 additions
and
9 deletions
source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
+
14
−
9
View file @
bbea214b
...
...
@@ -211,7 +211,7 @@ void DebugDrawerComponent::drawText(const std::string &layerName, const std::str
layer
->
mainNode
->
addChild
(
sep
);
}
void
DebugDrawerComponent
::
drawSphere
(
const
std
::
string
&
name
,
const
Eigen
::
Vector3f
&
position
,
const
VisualizationFactory
::
Color
&
color
,
float
radius
)
void
DebugDrawerComponent
::
drawSphere
(
const
std
::
string
&
layerName
,
const
std
::
string
&
name
,
const
Eigen
::
Vector3f
&
position
,
const
VisualizationFactory
::
Color
&
color
,
float
radius
)
{
ScopedRecursiveLockPtr
l
=
getScopedLock
();
ARMARX_DEBUG
<<
"drawSphere"
;
...
...
@@ -235,8 +235,8 @@ void DebugDrawerComponent::drawSphere(const std::string &name, const Eigen::Vect
sphere
->
radius
=
radius
;
sep
->
addChild
(
sphere
);
addedSphereVisualizations
[
name
]
=
sep
;
debugVisu
->
addChild
(
sep
);
layer
->
addedSphereVisualizations
[
name
]
=
sep
;
layer
->
mainNode
->
addChild
(
sep
);
}
...
...
@@ -291,16 +291,21 @@ void DebugDrawerComponent::removeText(const std::string &layerName, const std::s
layer
->
addedTextVisualizations
.
erase
(
name
);
}
void
DebugDrawerComponent
::
removeSphere
(
const
std
::
string
&
name
)
void
DebugDrawerComponent
::
removeSphere
(
const
std
::
string
&
layerName
,
const
std
::
string
&
name
)
{
if
(
!
hasLayer
(
layerName
))
{
return
;
}
ScopedRecursiveLockPtr
l
=
getScopedLock
();
if
(
addedTextVisualizations
.
find
(
name
)
==
addedTextVisualizations
.
end
())
auto
layer
=
layers
.
at
(
layerName
);
if
(
layer
->
addedSphereVisualizations
.
find
(
name
)
==
layer
->
addedSphereVisualizations
.
end
())
{
return
;
}
debugVisu
->
removeChild
(
addedSphereVisualizations
[
name
]);
addedSphereVisualizations
.
erase
(
name
);
layer
->
mainNode
->
removeChild
(
layer
->
addedSphereVisualizations
[
name
]);
layer
->
addedSphereVisualizations
.
erase
(
name
);
}
...
...
@@ -401,7 +406,7 @@ void DebugDrawerComponent::setSphereVisu(const std::string &layerName, const std
{
ARMARX_DEBUG
<<
VAROUT
(
layerName
)
<<
VAROUT
(
sphereName
);
drawSphere
(
sphereName
,
Vector3Ptr
::
dynamicCast
(
globalPosition
)
->
toEigen
(),
VirtualRobot
::
VisualizationFactory
::
Color
(
color
.
r
,
color
.
g
,
color
.
b
,
1
-
color
.
a
),
radius
);
drawSphere
(
layerName
,
sphereName
,
Vector3Ptr
::
dynamicCast
(
globalPosition
)
->
toEigen
(),
VirtualRobot
::
VisualizationFactory
::
Color
(
color
.
r
,
color
.
g
,
color
.
b
,
1
-
color
.
a
),
radius
);
}
void
DebugDrawerComponent
::
setSphereDebugLayerVisu
(
const
std
::
string
&
sphereName
,
const
Vector3BasePtr
&
globalPosition
,
const
DrawColor
&
color
,
float
radius
,
const
Ice
::
Current
&
)
...
...
@@ -411,7 +416,7 @@ void DebugDrawerComponent::setSphereDebugLayerVisu(const std::string &sphereName
void
DebugDrawerComponent
::
removeSphereVisu
(
const
std
::
string
&
layerName
,
const
std
::
string
&
sphereName
,
const
Ice
::
Current
&
)
{
removeSphere
(
sphereName
);
removeSphere
(
layerName
,
sphereName
);
}
void
DebugDrawerComponent
::
removeSphereDebugLayerVisu
(
const
std
::
string
&
sphereName
,
const
Ice
::
Current
&
)
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h
+
1
−
0
View file @
bbea214b
...
...
@@ -156,6 +156,7 @@ protected:
void
removeLine
(
const
std
::
string
&
layerName
,
const
std
::
string
&
name
);
void
removeBox
(
const
std
::
string
&
layerName
,
const
std
::
string
&
name
);
void
removeText
(
const
std
::
string
&
layerName
,
const
std
::
string
&
name
);
void
removeSphere
(
const
std
::
string
&
layerName
,
const
std
::
string
&
name
);
struct
Layer
{
...
...
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