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
2507e8a9
Commit
2507e8a9
authored
Apr 27, 2022
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
handle collab zones
parent
d2081b3d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/dummy_pickplace_provider.cpp
+22
-18
22 additions, 18 deletions
src/dummy_pickplace_provider.cpp
src/moveit_sorting_controller.cpp
+15
-0
15 additions, 0 deletions
src/moveit_sorting_controller.cpp
with
37 additions
and
18 deletions
src/dummy_pickplace_provider.cpp
+
22
−
18
View file @
2507e8a9
/*! \file dummy_
selection
_provider.cpp
/*! \file dummy_
pickplace
_provider.cpp
A ROS node that can trigger
pick-place and pick-drop
commands
on
cell
s
A ROS node that can trigger
robot
commands
in a
cell
\author Johannes Mey
\author Johannes Mey
\date 26.04.2022
\date 26.04.2022
...
@@ -37,13 +37,10 @@ int main(int argc, char** argv)
...
@@ -37,13 +37,10 @@ int main(int argc, char** argv)
client_connection
->
initializeConnection
(
client_connection
->
initializeConnection
(
[](
auto
t
,
auto
m
)
{
ROS_WARN_STREAM
(
"ignoring message "
<<
m
<<
" on topic "
<<
t
);
});
[](
auto
t
,
auto
m
)
{
ROS_WARN_STREAM
(
"ignoring message "
<<
m
<<
" on topic "
<<
t
);
});
ros
::
Subscriber
sub_select
=
n
.
subscribe
<
std_msgs
::
String
>
(
prefix
+
"/p
p
"
,
1000
,
[
&
](
auto
&
m
)
{
ros
::
Subscriber
sub_select
=
n
.
subscribe
<
std_msgs
::
String
>
(
prefix
+
"/p
ickplace
"
,
1000
,
[
&
](
auto
&
m
)
{
std
::
string
command
=
m
->
data
;
std
::
string
command
=
m
->
data
;
ROS_INFO_STREAM
(
"Selecting pick/place command: "
<<
command
);
Command
c
;
Command
c
;
size_t
pos
=
command
.
find
(
','
);
size_t
pos
=
command
.
find
(
','
);
c
.
mutable_pickandplace
()
->
set_idpick
(
command
.
substr
(
0
,
pos
));
c
.
mutable_pickandplace
()
->
set_idpick
(
command
.
substr
(
0
,
pos
));
command
.
erase
(
0
,
pos
+
1
);
command
.
erase
(
0
,
pos
+
1
);
...
@@ -56,18 +53,10 @@ int main(int argc, char** argv)
...
@@ -56,18 +53,10 @@ int main(int argc, char** argv)
client_connection
->
send
(
"/"
+
target_cell
+
"/command"
,
c
.
SerializeAsString
());
client_connection
->
send
(
"/"
+
target_cell
+
"/command"
,
c
.
SerializeAsString
());
});
});
ROS_INFO_STREAM
(
"DUMMY PICK-PLACE-PROVIDER"
<<
std
::
endl
<<
"To trigger a commend, use"
<<
std
::
endl
<<
" rostopic pub -1 /ccf/"
<<
prefix
<<
"/pp std_msgs/String
\"
<object>,<target>,<robot>
\"
"
);
ros
::
Subscriber
sub_evacuate
=
n
.
subscribe
<
std_msgs
::
String
>
(
prefix
+
"/evacuate"
,
1000
,
[
&
](
auto
&
m
)
{
ros
::
Subscriber
sub_evacuate
=
n
.
subscribe
<
std_msgs
::
String
>
(
prefix
+
"/evacuate"
,
1000
,
[
&
](
auto
&
m
)
{
std
::
string
command
=
m
->
data
;
std
::
string
command
=
m
->
data
;
ROS_INFO_STREAM
(
"Selecting evacuate command: "
<<
command
);
Command
c
;
Command
c
;
size_t
pos
=
command
.
find
(
','
);
size_t
pos
=
command
.
find
(
','
);
c
.
mutable_evacuate
()
->
set_idcollaborationzone
(
command
.
substr
(
0
,
pos
));
c
.
mutable_evacuate
()
->
set_idcollaborationzone
(
command
.
substr
(
0
,
pos
));
command
.
erase
(
0
,
pos
+
1
);
command
.
erase
(
0
,
pos
+
1
);
...
@@ -77,12 +66,27 @@ int main(int argc, char** argv)
...
@@ -77,12 +66,27 @@ int main(int argc, char** argv)
client_connection
->
send
(
"/"
+
target_cell
+
"/command"
,
c
.
SerializeAsString
());
client_connection
->
send
(
"/"
+
target_cell
+
"/command"
,
c
.
SerializeAsString
());
});
});
ROS_INFO_STREAM
(
"DUMMY PICK-PLACE-PROVIDER"
<<
std
::
endl
ros
::
Subscriber
sub_change_zone
=
n
.
subscribe
<
std_msgs
::
String
>
(
prefix
+
"/configzone"
,
1000
,
[
&
](
auto
&
m
)
{
<<
"To trigger a commend, use"
<<
std
::
endl
std
::
string
command
=
m
->
data
;
Command
c
;
size_t
pos
=
command
.
find
(
','
);
c
.
mutable_configchange
()
->
set_idcollaborationzone
(
command
.
substr
(
0
,
pos
));
command
.
erase
(
0
,
pos
+
1
);
c
.
mutable_configchange
()
->
set_idrobotnewowner
(
command
);
ROS_INFO_STREAM
(
"sending command to assign robot "
<<
c
.
configchange
().
idrobotnewowner
()
<<
" to zone "
<<
c
.
configchange
().
idcollaborationzone
());
client_connection
->
send
(
"/"
+
target_cell
+
"/command"
,
c
.
SerializeAsString
());
});
ROS_INFO_STREAM
(
"ROBOT COMMAND PROVIDER"
<<
std
::
endl
<<
"To trigger a command, use"
<<
std
::
endl
<<
" rostopic pub -1 /ccf/"
<<
prefix
<<
"/pickplace std_msgs/String
\"
<object>,<target>,<robot>
\"
"
<<
std
::
endl
<<
" rostopic pub -1 /ccf/"
<<
prefix
<<
" rostopic pub -1 /ccf/"
<<
prefix
<<
"/
pp
std_msgs/String
\"
<
object>,<target
>,<robot>
\"
"
<<
std
::
endl
<<
"/
evacuate
std_msgs/String
\"
<
collaboration_zone
>,<robot>
\"
"
<<
std
::
endl
<<
" rostopic pub -1 /ccf/"
<<
prefix
<<
" rostopic pub -1 /ccf/"
<<
prefix
<<
"/
evacuat
e std_msgs/String
\"
<collaboration_zone>,<robot>
\"
"
);
<<
"/
configzon
e std_msgs/String
\"
<collaboration_zone>,<robot>
\"
"
);
ros
::
spin
();
ros
::
spin
();
...
...
This diff is collapsed.
Click to expand it.
src/moveit_sorting_controller.cpp
+
15
−
0
View file @
2507e8a9
...
@@ -139,6 +139,21 @@ int main(int argc, char **argv)
...
@@ -139,6 +139,21 @@ int main(int argc, char **argv)
pose
.
position
.
z
=
1.3
;
pose
.
position
.
z
=
1.3
;
controller
.
moveToPose
(
*
robot
,
pose
,
false
);
controller
.
moveToPose
(
*
robot
,
pose
,
false
);
}
else
if
(
command
.
has_configchange
())
{
Object
*
zone
=
controller
.
resolveObject
(
command
.
configchange
().
idcollaborationzone
());
if
(
!
zone
)
{
ROS_ERROR_STREAM
(
"Unable to configure unknown collaboration zone '"
<<
command
.
evacuate
().
idrobot
()
<<
"'."
);
return
;
}
Object
*
robot
=
controller
.
resolveObject
(
command
.
configchange
().
idrobotnewowner
());
if
(
!
robot
)
{
ROS_WARN_STREAM
(
"Collaboration zone active for unknown robot '"
<<
command
.
evacuate
().
idrobot
()
<<
"', so blocked in all."
);
}
controller
.
configureCollaborationZone
(
*
zone
,
command
.
configchange
().
idrobotnewowner
()
!=
controller
.
getRobotName
());
}
else
{
}
else
{
ROS_WARN_STREAM
(
"Ignoring command that is not PickAndPlace but "
<<
command
.
msg_case
());
ROS_WARN_STREAM
(
"Ignoring command that is not PickAndPlace but "
<<
command
.
msg_case
());
}
}
...
...
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