Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CCF Immersive Sorting Demo
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CeTI
ROS
CeTI Cobotic Framework
CCF Immersive Sorting Demo
Commits
2d2cf7cc
Commit
2d2cf7cc
authored
Apr 26, 2022
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
also publish drop-off locations
parent
836694ff
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dummy_selection_provider.cpp
+14
-1
14 additions, 1 deletion
src/dummy_selection_provider.cpp
with
14 additions
and
1 deletion
src/dummy_selection_provider.cpp
+
14
−
1
View file @
2d2cf7cc
...
@@ -80,6 +80,7 @@ int main(int argc, char **argv) {
...
@@ -80,6 +80,7 @@ int main(int argc, char **argv) {
n
.
subscribe
<
std_msgs
::
String
>
(
prefix
+
"/select"
,
1000
,
[
&
](
auto
&
m
)
{
sendSelection
(
m
->
data
);
});
n
.
subscribe
<
std_msgs
::
String
>
(
prefix
+
"/select"
,
1000
,
[
&
](
auto
&
m
)
{
sendSelection
(
m
->
data
);
});
ros
::
Publisher
pub_objects
=
n
.
advertise
<
std_msgs
::
String
>
(
prefix
+
"/objects"
,
1
);
ros
::
Publisher
pub_objects
=
n
.
advertise
<
std_msgs
::
String
>
(
prefix
+
"/objects"
,
1
);
ros
::
Publisher
pub_bins
=
n
.
advertise
<
std_msgs
::
String
>
(
prefix
+
"/bins"
,
1
);
ros
::
Publisher
pub_bins
=
n
.
advertise
<
std_msgs
::
String
>
(
prefix
+
"/bins"
,
1
);
ros
::
Publisher
pub_locations
=
n
.
advertise
<
std_msgs
::
String
>
(
prefix
+
"/locations"
,
1
);
while
(
ros
::
ok
())
{
while
(
ros
::
ok
())
{
...
@@ -106,12 +107,15 @@ int main(int argc, char **argv) {
...
@@ -106,12 +107,15 @@ int main(int argc, char **argv) {
// collect all object names
// collect all object names
std
::
vector
<
std
::
string
>
objects
{};
std
::
vector
<
std
::
string
>
objects
{};
std
::
vector
<
std
::
string
>
bins
{};
std
::
vector
<
std
::
string
>
bins
{};
std
::
vector
<
std
::
string
>
locs
{};
for
(
const
auto
&
object
:
scene
.
objects
())
{
for
(
const
auto
&
object
:
scene
.
objects
())
{
ROS_DEBUG_STREAM
(
"found object "
<<
object
.
id
()
<<
" of type "
<<
Object_Type_Name
(
object
.
type
()));
ROS_DEBUG_STREAM
(
"found object "
<<
object
.
id
()
<<
" of type "
<<
Object_Type_Name
(
object
.
type
()));
if
(
object
.
type
()
==
Object_Type_BOX
)
{
if
(
object
.
type
()
==
Object_Type_BOX
)
{
objects
.
push_back
(
object
.
id
());
objects
.
push_back
(
object
.
id
());
}
else
if
(
object
.
type
()
==
Object_Type_BIN
)
{
}
else
if
(
object
.
type
()
==
Object_Type_BIN
)
{
bins
.
push_back
(
object
.
id
());
bins
.
push_back
(
object
.
id
());
}
else
if
(
object
.
type
()
==
Object_Type_DROP_OFF_LOCATION
)
{
locs
.
push_back
(
object
.
id
());
}
}
}
}
...
@@ -133,6 +137,15 @@ int main(int argc, char **argv) {
...
@@ -133,6 +137,15 @@ int main(int argc, char **argv) {
pub_bins
.
publish
(
bins_msg
);
pub_bins
.
publish
(
bins_msg
);
std_msgs
::
String
locs_msg
;
bins_msg
.
data
=
locs
.
empty
()
?
""
:
std
::
accumulate
(
++
locs
.
begin
(),
locs
.
end
(),
*
locs
.
begin
(),
[](
auto
&
a
,
auto
&
b
)
{
return
a
+
","
+
b
;
});
pub_locations
.
publish
(
locs_msg
);
if
(
autoselect
)
{
if
(
autoselect
)
{
if
(
objects
.
empty
())
{
if
(
objects
.
empty
())
{
ROS_INFO
(
"No objects to select in a scene without boxes!"
);
ROS_INFO
(
"No objects to select in a scene without boxes!"
);
...
...
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