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
fe67711a
Commit
fe67711a
authored
4 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Fix constness of ObjectFinder, add flag to disable checking of files
parent
8a8c0f4a
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
+9
-9
9 additions, 9 deletions
...e/RobotAPI/components/ObjectPoseObserver/ObjectFinder.cpp
source/RobotAPI/components/ObjectPoseObserver/ObjectFinder.h
+9
-9
9 additions, 9 deletions
source/RobotAPI/components/ObjectPoseObserver/ObjectFinder.h
with
18 additions
and
18 deletions
source/RobotAPI/components/ObjectPoseObserver/ObjectFinder.cpp
+
9
−
9
View file @
fe67711a
...
...
@@ -17,7 +17,7 @@ namespace armarx
Logging
::
setTag
(
"ObjectFinder"
);
}
void
ObjectFinder
::
init
()
void
ObjectFinder
::
init
()
const
{
if
(
packageDataDir
.
empty
())
{
...
...
@@ -36,7 +36,7 @@ namespace armarx
}
std
::
optional
<
ObjectInfo
>
ObjectFinder
::
findObject
(
const
std
::
string
&
project
,
const
std
::
string
&
name
)
std
::
optional
<
ObjectInfo
>
ObjectFinder
::
findObject
(
const
std
::
string
&
project
,
const
std
::
string
&
name
)
const
{
init
();
if
(
!
project
.
empty
())
...
...
@@ -65,7 +65,7 @@ namespace armarx
return
std
::
nullopt
;
}
std
::
optional
<
ObjectInfo
>
ObjectFinder
::
findObject
(
const
std
::
string
&
nameOrID
)
std
::
optional
<
ObjectInfo
>
ObjectFinder
::
findObject
(
const
std
::
string
&
nameOrID
)
const
{
init
();
if
(
nameOrID
.
find
(
"/"
)
!=
nameOrID
.
npos
)
...
...
@@ -81,7 +81,7 @@ namespace armarx
}
}
std
::
vector
<
std
::
string
>
ObjectFinder
::
getProjects
()
std
::
vector
<
std
::
string
>
ObjectFinder
::
getProjects
()
const
{
init
();
const
bool
local
=
true
;
...
...
@@ -89,14 +89,14 @@ namespace armarx
return
std
::
vector
<
std
::
string
>
(
paths
.
begin
(),
paths
.
end
());
}
std
::
vector
<
ObjectFinder
::
path
>
ObjectFinder
::
getProjectDirectories
()
std
::
vector
<
ObjectFinder
::
path
>
ObjectFinder
::
getProjectDirectories
()
const
{
init
();
const
bool
local
=
false
;
return
simox
::
fs
::
list_directory
(
_rootDirAbs
(),
local
);
}
std
::
vector
<
ObjectInfo
>
ObjectFinder
::
findAllObjects
(
)
std
::
vector
<
ObjectInfo
>
ObjectFinder
::
findAllObjects
(
bool
checkPaths
)
const
{
init
();
const
bool
local
=
true
;
...
...
@@ -105,14 +105,14 @@ namespace armarx
{
if
(
fs
::
is_directory
(
_rootDirAbs
()
/
projectDir
))
{
std
::
vector
<
ObjectInfo
>
project
=
findAllObjectsOfProject
(
projectDir
);
std
::
vector
<
ObjectInfo
>
project
=
findAllObjectsOfProject
(
projectDir
,
checkPaths
);
objects
.
insert
(
objects
.
end
(),
project
.
begin
(),
project
.
end
());
}
}
return
objects
;
}
std
::
vector
<
ObjectInfo
>
ObjectFinder
::
findAllObjectsOfProject
(
const
std
::
string
&
project
)
std
::
vector
<
ObjectInfo
>
ObjectFinder
::
findAllObjectsOfProject
(
const
std
::
string
&
project
,
bool
checkPaths
)
const
{
init
();
path
projectDir
=
_rootDirAbs
()
/
project
;
...
...
@@ -130,7 +130,7 @@ namespace armarx
if
(
fs
::
is_directory
(
projectDir
/
dir
))
{
ObjectInfo
object
(
packageName
,
packageDataDir
,
project
,
dir
.
filename
());
if
(
object
.
checkPaths
())
if
(
!
checkPaths
||
object
.
checkPaths
())
{
objects
.
push_back
(
object
);
}
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/components/ObjectPoseObserver/ObjectFinder.h
+
9
−
9
View file @
fe67711a
...
...
@@ -20,20 +20,20 @@ namespace armarx
ObjectFinder
(
const
std
::
string
&
objectsPackageName
=
"ArmarXObjects"
);
std
::
optional
<
ObjectInfo
>
findObject
(
const
std
::
string
&
project
,
const
std
::
string
&
name
);
std
::
optional
<
ObjectInfo
>
findObject
(
const
std
::
string
&
nameOrID
);
std
::
optional
<
ObjectInfo
>
findObject
(
const
std
::
string
&
project
,
const
std
::
string
&
name
)
const
;
std
::
optional
<
ObjectInfo
>
findObject
(
const
std
::
string
&
nameOrID
)
const
;
std
::
vector
<
std
::
string
>
getProjects
();
std
::
vector
<
path
>
getProjectDirectories
();
std
::
vector
<
std
::
string
>
getProjects
()
const
;
std
::
vector
<
path
>
getProjectDirectories
()
const
;
std
::
vector
<
ObjectInfo
>
findAllObjects
(
)
;
std
::
vector
<
ObjectInfo
>
findAllObjectsOfProject
(
const
std
::
string
&
project
)
;
std
::
vector
<
ObjectInfo
>
findAllObjects
(
bool
checkPaths
=
true
)
const
;
std
::
vector
<
ObjectInfo
>
findAllObjectsOfProject
(
const
std
::
string
&
project
,
bool
checkPaths
=
true
)
const
;
private:
void
init
();
void
init
()
const
;
path
_rootDirAbs
()
const
;
path
_rootDirRel
()
const
;
...
...
@@ -42,10 +42,10 @@ namespace armarx
/// Name of package containing the object models (ArmarXObjects by default).
std
::
string
packageName
;
mutable
std
::
string
packageName
;
/// Absolute path to data directory (e.g. "/.../repos/ArmarXObjects/data").
path
packageDataDir
;
mutable
path
packageDataDir
;
};
...
...
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