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
ac0d49eb
Commit
ac0d49eb
authored
3 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
rename main controller and add launch file
parent
c2915081
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+4
-4
4 additions, 4 deletions
CMakeLists.txt
launch/virtual-table_main_controller.launch
+2
-2
2 additions, 2 deletions
launch/virtual-table_main_controller.launch
src/main_controller.cpp
+20
-4
20 additions, 4 deletions
src/main_controller.cpp
with
26 additions
and
10 deletions
CMakeLists.txt
+
4
−
4
View file @
ac0d49eb
...
...
@@ -136,7 +136,7 @@ include_directories(
## The recommended prefix ensures that target names across packages don't collide
add_executable
(
${
PROJECT_NAME
}
_dummy_selection_provider src/dummy_selection_provider.cpp
${
PROTO_SRCS
}
${
PROTO_HDRS
}
)
add_executable
(
${
PROJECT_NAME
}
_dummy_sorting_controller src/dummy_sorting_controller.cpp
${
PROTO_SRCS
}
${
PROTO_HDRS
}
)
add_executable
(
${
PROJECT_NAME
}
_
dummy_
main_controller src/
dummy_
main_controller.cpp
${
PROTO_SRCS
}
${
PROTO_HDRS
}
)
add_executable
(
${
PROJECT_NAME
}
_main_controller src/main_controller.cpp
${
PROTO_SRCS
}
${
PROTO_HDRS
}
)
add_executable
(
${
PROJECT_NAME
}
_moveit_sorting_controller src/moveit_sorting_controller.cpp
${
PROTO_SRCS
}
${
PROTO_HDRS
}
)
...
...
@@ -146,21 +146,21 @@ add_executable(${PROJECT_NAME}_moveit_sorting_controller src/moveit_sorting_cont
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
set_target_properties
(
${
PROJECT_NAME
}
_dummy_selection_provider PROPERTIES OUTPUT_NAME dummy_selection_provider PREFIX
""
)
set_target_properties
(
${
PROJECT_NAME
}
_dummy_sorting_controller PROPERTIES OUTPUT_NAME dummy_sorting_controller PREFIX
""
)
set_target_properties
(
${
PROJECT_NAME
}
_
dummy_
main_controller PROPERTIES OUTPUT_NAME
dummy_
main_controller PREFIX
""
)
set_target_properties
(
${
PROJECT_NAME
}
_main_controller PROPERTIES OUTPUT_NAME main_controller PREFIX
""
)
set_target_properties
(
${
PROJECT_NAME
}
_moveit_sorting_controller PROPERTIES OUTPUT_NAME moveit_sorting_controller PREFIX
""
)
## Add cmake target dependencies of the executable
## same as for the library above
add_dependencies
(
${
PROJECT_NAME
}
_dummy_selection_provider
${${
PROJECT_NAME
}
_EXPORTED_TARGETS
}
${
catkin_EXPORTED_TARGETS
}
)
add_dependencies
(
${
PROJECT_NAME
}
_dummy_sorting_controller
${${
PROJECT_NAME
}
_EXPORTED_TARGETS
}
${
catkin_EXPORTED_TARGETS
}
)
add_dependencies
(
${
PROJECT_NAME
}
_
dummy_
main_controller
${${
PROJECT_NAME
}
_EXPORTED_TARGETS
}
${
catkin_EXPORTED_TARGETS
}
)
add_dependencies
(
${
PROJECT_NAME
}
_main_controller
${${
PROJECT_NAME
}
_EXPORTED_TARGETS
}
${
catkin_EXPORTED_TARGETS
}
)
add_dependencies
(
${
PROJECT_NAME
}
_moveit_sorting_controller
${${
PROJECT_NAME
}
_EXPORTED_TARGETS
}
${
catkin_EXPORTED_TARGETS
}
)
## Specify libraries to link a library or executable target against
target_link_libraries
(
${
PROJECT_NAME
}
_dummy_sorting_controller
${
catkin_LIBRARIES
}
)
target_link_libraries
(
${
PROJECT_NAME
}
_
dummy_
main_controller
target_link_libraries
(
${
PROJECT_NAME
}
_main_controller
${
catkin_LIBRARIES
}
)
target_link_libraries
(
${
PROJECT_NAME
}
_moveit_sorting_controller
...
...
This diff is collapsed.
Click to expand it.
launch/virtual-table_
dummy_main
.launch
→
launch/virtual-table_
main_controller
.launch
+
2
−
2
View file @
ac0d49eb
<launch>
<arg name="connection_address" default="tcp://*:6576" />
<arg name="client_controllers" default="[]" />
<arg name="client_controllers" default="[
'ads', 'st', 'ceti'
]" />
<node pkg="ccf_immersive_sorting" type="
dummy_
main_controller" name="
dummy_
main_controller
_instance
" output="screen" >
<node pkg="ccf_immersive_sorting" type="main_controller" name="main_controller" output="screen" >
<param name="connection_address" type="string" value="$(arg connection_address)" />
<param name="client_controllers" type="yaml" value="$(arg client_controllers)" />
<param name="scene" type="string" value="$(find ccf_immersive_sorting)/config/config_scene_virtual-table.json" />
...
...
This diff is collapsed.
Click to expand it.
src/
dummy_
main_controller.cpp
→
src/main_controller.cpp
+
20
−
4
View file @
ac0d49eb
...
...
@@ -15,6 +15,7 @@
#include
"ccf/controller/DummyRobotArmController.h"
#include
"ccf/connection/NngConnection.h"
#include
"ccf/connection/MqttConnection.h"
#include
"ccf/util/NodeUtil.h"
std
::
string
NODE_NAME
=
"dummy_sorting_controller"
;
...
...
@@ -47,6 +48,9 @@ int main(int argc, char **argv) {
DummyRobotArmController
connector
{
n
,
NODE_NAME
};
std
::
map
<
std
::
string
,
Scene
>
clients
;
std
::
vector
<
std
::
pair
<
std
::
string
,
std
::
string
>>
actions
;
// add an NNG connection
std
::
unique_ptr
<
NngConnection
>
connection
=
std
::
make_unique
<
NngConnection
>
(
connectionAddress
);
connection
->
setReceiveTopic
(
getParameter
<
std
::
string
>
(
n
,
"topics/selection"
,
"selection"
));
...
...
@@ -54,14 +58,16 @@ int main(int argc, char **argv) {
connector
.
addConnection
(
std
::
move
(
connection
));
auto
clientControllers
=
getPrivateParameter
<
std
::
vector
<
std
::
string
>>
(
"client_controllers"
);
auto
mqttServer
=
getPrivateParameter
<
std
::
string
>
(
"mqtt_server"
,
"localhost:1883"
);
ROS_INFO_STREAM
(
"Connecting to "
<<
clientControllers
.
size
()
<<
" client controllers."
);
std
::
shared_ptr
<
MqttConnection
>
client_connection
=
std
::
make_shared
<
MqttConnection
>
(
NODE_NAME
,
mqttServer
);
connector
.
addConnection
(
client_connection
);
for
(
const
auto
&
client
:
clientControllers
)
{
ROS_INFO_STREAM
(
"Connecting to client at "
<<
client
<<
"."
);
std
::
unique_ptr
<
NngConnection
>
client_connection
=
std
::
make_unique
<
NngConnection
>
(
client
,
false
);
client_connection
->
setSendTopic
(
getParameter
<
std
::
string
>
(
n
,
"topics/selection"
,
"selection"
));
client_connection
->
setReceiveTopic
(
"client_scene"
);
connector
.
addConnection
(
std
::
move
(
client_connection
));
auto
scene_update_topic
=
"/"
+
client
+
getParameter
(
n
,
"topics/scene"
,
NODE_NAME
+
"/scene/update"
);
client_connection
->
listen
(
scene_update_topic
);
connector
.
addCallback
(
scene_update_topic
,
[
client
,
&
clients
](
auto
msg
)
{
clients
[
client
].
ParseFromString
(
msg
);});
}
connector
.
loadScene
(
getPrivateParameter
<
std
::
string
>
(
"scene"
,
ros
::
package
::
getPath
(
"ccf_immersive_sorting"
)
+
...
...
@@ -77,6 +83,16 @@ int main(int argc, char **argv) {
ros
::
Timer
timer
=
n
.
createTimer
(
ros
::
Duration
(
10
),
[
&
connector
](
const
ros
::
TimerEvent
&
event
)
{
connector
.
sendScene
();
});
// send a scene every ten seconds
ros
::
Timer
timer_scene_log
=
n
.
createTimer
(
ros
::
Duration
(
10
),
[
&
clients
](
const
ros
::
TimerEvent
&
event
)
{
for
(
const
auto
&
[
name
,
scene
]
:
clients
)
{
ROS_WARN_STREAM
(
"CLIENT "
<<
name
<<
" has a scene with "
<<
scene
.
objects_size
()
<<
"objects"
);
}
});
auto
selectionMessageCallback
=
[
&
currentlyPickedBox
,
&
connector
,
&
robot
,
&
selectedBox
,
&
selectedBin
,
&
n
](
const
Selection
&
selection
)
{
...
...
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