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
6c1dd70e
Commit
6c1dd70e
authored
4 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Add access to AABB
parent
fe67711a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!71
Object pose observer
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/components/ObjectPoseObserver/ObjectFinder.cpp
+17
-0
17 additions, 0 deletions
...e/RobotAPI/components/ObjectPoseObserver/ObjectFinder.cpp
source/RobotAPI/components/ObjectPoseObserver/ObjectFinder.h
+9
-0
9 additions, 0 deletions
source/RobotAPI/components/ObjectPoseObserver/ObjectFinder.h
with
26 additions
and
0 deletions
source/RobotAPI/components/ObjectPoseObserver/ObjectFinder.cpp
+
17
−
0
View file @
6c1dd70e
#include
"ObjectFinder.h"
#include
<SimoxUtility/filesystem/list_directory.h>
#include
<SimoxUtility/json.h>
#include
<SimoxUtility/shapes/AxisAlignedBoundingBox.h>
#include
<ArmarXCore/core/exceptions/local/ExpressionException.h>
#include
<ArmarXCore/core/system/cmake/CMakePackageFinder.h>
...
...
@@ -207,6 +209,21 @@ namespace armarx
return
file
(
".obj"
);
}
PackageFileLocation
ObjectInfo
::
boundingBoxJson
()
const
{
return
file
(
".json"
,
"_bb"
);
}
simox
::
AxisAlignedBoundingBox
ObjectInfo
::
aabb
()
const
{
nlohmann
::
json
j
=
nlohmann
::
read_json
(
boundingBoxJson
().
absolutePath
);
nlohmann
::
json
jaabb
=
j
.
at
(
"aabb"
);
auto
min
=
jaabb
.
at
(
"min"
).
get
<
Eigen
::
Vector3f
>
();
auto
max
=
jaabb
.
at
(
"max"
).
get
<
Eigen
::
Vector3f
>
();
return
simox
::
AxisAlignedBoundingBox
(
min
,
max
);
}
bool
ObjectInfo
::
checkPaths
()
const
{
namespace
fs
=
std
::
filesystem
;
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/components/ObjectPoseObserver/ObjectFinder.h
+
9
−
0
View file @
6c1dd70e
...
...
@@ -4,6 +4,10 @@
#include
<ArmarXCore/core/logging/Logging.h>
namespace
simox
{
struct
AxisAlignedBoundingBox
;
}
namespace
armarx
{
...
...
@@ -82,6 +86,11 @@ namespace armarx
PackageFileLocation
simoxXML
()
const
;
PackageFileLocation
wavefrontObj
()
const
;
PackageFileLocation
boundingBoxJson
()
const
;
simox
::
AxisAlignedBoundingBox
aabb
()
const
;
/**
* @brief Checks the existence of expected files.
* If a file is does not exist, emits a warning returns false.
...
...
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