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
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
ae6e1a26
Commit
ae6e1a26
authored
2 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
change default node name for debug purposes
parent
13073468
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/moveit_sorting_controller.cpp
+9
-10
9 additions, 10 deletions
src/moveit_sorting_controller.cpp
with
9 additions
and
10 deletions
src/moveit_sorting_controller.cpp
+
9
−
10
View file @
ae6e1a26
...
...
@@ -18,7 +18,7 @@
#include
"ccf/connection/MqttConnection.h"
#include
"ccf/util/NodeUtil.h"
std
::
string
NODE_NAME
=
"ceti_cell_
placeworld
"
;
std
::
string
NODE_NAME
=
"ceti_cell_
empty
"
;
using
CetiRosToolbox
::
getParameter
;
using
CetiRosToolbox
::
getPrivateParameter
;
...
...
@@ -41,7 +41,7 @@ int main(int argc, char** argv)
std
::
unique_ptr
<
MqttConnection
>
mqtt_connection
=
std
::
make_unique
<
MqttConnection
>
(
mqttServer
,
ros
::
this_node
::
getName
());
mqtt_connection
->
listen
(
getParameter
<
std
::
string
>
(
n
,
"topics/selection"
,
"selection"
));
auto
commandTopic
=
getParameter
<
std
::
string
>
(
n
,
"topics/command"
,
"/ceti_cell_placeworld
/command"
);
auto
commandTopic
=
getParameter
<
std
::
string
>
(
n
,
"topics/command"
,
NODE_NAME
+
"
/command"
);
mqtt_connection
->
listen
(
commandTopic
);
auto
other_cell_topic
=
getPrivateParameter
<
std
::
string
>
(
"other_cell"
,
"/ceti_cell_2_placeworld/scene/delta-update"
);
mqtt_connection
->
listen
(
other_cell_topic
);
...
...
@@ -76,20 +76,19 @@ int main(int argc, char** argv)
});
auto
pick_place_callback
=
[
&
controller
](
const
Command
&
command
)
{
const
PickAndPlace
&
pick_place
=
command
.
pickandplace
();
if
(
command
.
has_pickandplace
())
{
ROS_INFO_STREAM
(
"[COMMAND] for robot "
<<
pick_place
.
idrobot
()
<<
": Pick object "
<<
pick_place
.
idpick
()
<<
" and place it at "
<<
pick_place
.
idplace
());
Object
*
pick_object
=
controller
.
resolveObject
(
pick_place
.
idpick
());
if
(
!
pick_object
)
{
ROS_ERROR_STREAM
(
"[COMMAND] FAILED! Selected unknown pick object '"
<<
pick
_
place
.
idpick
()
<<
"'"
);
ROS_ERROR_STREAM
(
"[COMMAND] FAILED! Selected unknown pick object '"
<<
command
.
pick
and
place
()
.
idpick
()
<<
"'"
);
return
;
}
Object
*
place_object
=
controller
.
resolveObject
(
pick
_
place
.
idplace
());
Object
*
place_object
=
controller
.
resolveObject
(
command
.
pick
and
place
()
.
idplace
());
if
(
!
place_object
)
{
ROS_ERROR_STREAM
(
"[COMMAND] FAILED! Selected unknown place object '"
<<
pick
_
place
.
idplace
()
<<
"'"
);
ROS_ERROR_STREAM
(
"[COMMAND] FAILED! Selected unknown place object '"
<<
command
.
pick
and
place
()
.
idplace
()
<<
"'"
);
return
;
}
if
(
pick_object
->
type
()
!=
Object
::
BOX
)
...
...
@@ -119,11 +118,11 @@ int main(int argc, char** argv)
{
if
(
!
controller
.
pickAndDrop
(
*
robot
,
*
pick_object
,
*
place_object
,
false
))
{
ROS_WARN_STREAM
(
"[COMMAND] FAILED! Unable to remove box '"
<<
pick
_
place
.
idpick
()
<<
"'!"
);
ROS_WARN_STREAM
(
"[COMMAND] FAILED! Unable to remove box '"
<<
command
.
pick
and
place
()
.
idpick
()
<<
"'!"
);
}
else
{
ROS_INFO_STREAM
(
"[COMMAND] SUCCESS! '"
<<
pick
_
place
.
idpick
()
<<
"' is no more."
);
ROS_INFO_STREAM
(
"[COMMAND] SUCCESS! '"
<<
command
.
pick
and
place
()
.
idpick
()
<<
"' is no more."
);
controller
.
sendScene
();
}
}
...
...
@@ -131,11 +130,11 @@ int main(int argc, char** argv)
{
if
(
!
controller
.
pickAndPlace
(
*
robot
,
*
pick_object
,
*
place_object
,
false
))
{
ROS_WARN_STREAM
(
"[COMMAND] FAILED! Unable to move box '"
<<
pick
_
place
.
idpick
()
<<
"'!"
);
ROS_WARN_STREAM
(
"[COMMAND] FAILED! Unable to move box '"
<<
command
.
pick
and
place
()
.
idpick
()
<<
"'!"
);
}
else
{
ROS_INFO_STREAM
(
"[COMMAND] SUCCESS! "
<<
pick
_
place
.
idpick
()
<<
"' is at its new location."
);
ROS_INFO_STREAM
(
"[COMMAND] SUCCESS! "
<<
command
.
pick
and
place
()
.
idpick
()
<<
"' is at its new location."
);
controller
.
sendScene
();
}
}
...
...
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