Skip to content
Snippets Groups Projects
Commit 0bc8a8d5 authored by Johannes Mey's avatar Johannes Mey
Browse files

many fixes, removed launch files

parent 5ac8c53c
No related branches found
No related tags found
No related merge requests found
Showing
with 4 additions and 270 deletions
# CCF: The CeTI Cobotic Framework
**TODO** the documentation does not represent the current state of the framework and needs to be updated!
This ROS package provides a connection between a ROS-based model and the [CGV framework](https://github.com/sgumhold/cgv).
The purpose of this connection is to use the CGV framework to select and move elements from a scene provided by ROS
using an AR controller.
For the communication between the two components, messages encoded using
[Protocol Buffers](https://developers.google.com/protocol-buffers) (v3) are exchanged using
[NNG](https://nng.nanomsg.org/).
Since the package is under active development, it contains several demonstrators in varying development states.
In particular, besides the main demonstrator it contains several tests of NNG communication patterns that can be used
for internal and external testing.
## Generating the ROS-Documentation
- Source the workspace
```
$ source devel/setup.bash
```
- Generate the documentation
```
$ rosdoc_lite `rospack find ccf`
```
- You can view the generated files in you browser by opening the generated `index.html`
```
xdg-open `rospack find ccf`/doc/html/index.html
```
## Running the Tests
1. Build the package (this is not done automatically by the following commands)
```bash
catkin build
```
2. Build the tests
```bash
catkin build --make-args tests
```
3. Run the tests
```bash
rostest -t ccf test_NodeUtil.test
```
## CGV Dummy Controller Demonstrator
This demonstrator contains two mock-up nodes that can serve as stand-ins for future functional implementations.
- `dummy_cgv` is a mock-up of the cgv framework. it connects to the ROS `ccf` and waits for it to send a scene.
Once a `Scene` is received, it waits two seconds and then sends a selection of a random `Box` from the scene (if there
is one). After another two seconds, the `bin` is selected.
- `dummy_ccf` is a mock-up of the ros end of the connection, accepting connections from the CGV framework.
When receiving a message on topic `/ccf/send_scene`, it sends a scene to the framework. It furthermore is
able to receive object `Selection` messages (and currently simply prints a notification).
### Running the Example
- Checkout the project using git.
Since the CMake build uses git submodules, do not remove the git information!
It is not required to checkout the submodule manually, this is done using CMake.
- Build the project.
- Start ROS
```
$ roscore
```
- Start the `dummy_cgv_controller` and `dummy_cgv` nodes in two terminals.
Both are in the `ccf` namespace.
```
$ rosrun ccf dummy_cgv_controller
```
Note that the dummy_cgv tries to connect to the dummy_cgv_controller, so as long as the latter is not running,
warnings are logged.
```
$ rosrun ccf dummy_cgv
```
- Trigger a transmission by publishing a string message to `/ccf/send_scene`.
```
$ rostopic pub -1 /ccf/send_scene std_msgs/String "Some Message"
```
The `dummy_cgv` node command will show the received scene. With a delay of two seconds, selections of a box and a bin
will be logged by the `dummy_cgv_controller`
### Running the demo
#### Configuration
- configure the scene (*not* required when using the dummy controller):
```bash
rostopic pub -1 /scene_config std_msgs/String "\"$(roscat ccf config_scene.yaml)\""
```
#### Execution
- pick an object by id: `rostopic pub -1 /robot/pick std_msgs/String "objectRed1"`
- place a picked object into a bin by id: `rostopic pub -1 /robot/place std_msgs/String "binRed"`
### Connect to the CGV framework
- **CASE 1** The robot controller is *not* accepting connections, but the AR server is.
- ensure a SSH server is running on the AR server
- On the robot controller, connect to it
```
ssh stadmin@141.76.65.71 -R 6576:localhost:6576
```
### Using the Example with Docker
The following instructions can be used to run either the cgv dummy or the ros-connector dummy from within a docker container.
All commands involving docker must be run as root or as a user with docker privileges.
- Create a container called `ccf`
```
$ docker build --tag ccf .
```
- Run the container, exposing the port the receiver listens on, `6576`.
```
$ docker run -it -p 6576:6576 ros4ceti/cgv:latest roslaunch ccf dummy_cgv_controller.launch
```
Run the CGV dummy:
```
$ docker run -it --network host ros4ceti/cgv:latest roslaunch ccf dummy_cgv.launch
```
- The dummy_cgv_controller now is available and awaits NNG messages at `localhost:6576`.
**TODO** An updated documentation will follow soon.
\ No newline at end of file
connector_node_ros_cgv:
connector_node_ros_ccf:
topics:
selection: "selection"
max_grasp_approach_velocity: 0.2
......
{ 'objects': [
{ 'id': 'tablePillar1','pos': { 'x': 0.77,'y': 0.77,'z': 0.325 },'size': { 'length': 0.06,'width': 0.06,'height': 0.65 },'orientation': { 'w': 1 },'color': { 'r': 255,'g': 222,'b': 173 } },
{ 'id': 'tablePillar2','pos': { 'x': -0.77,'y': -0.77,'z': 0.325 },'size': { 'length': 0.06,'width': 0.06,'height': 0.65 },'orientation': { 'w': 1 },'color': { 'r': 255,'g': 222,'b': 173 } },
{ 'id': 'tablePillar3','pos': { 'x': -0.77,'y': 0.77,'z': 0.325 },'size': { 'length': 0.06,'width': 0.06,'height': 0.65 },'orientation': { 'w': 1 },'color': { 'r': 255,'g': 222,'b': 173 } },
{ 'id': 'tablePillar4','pos': { 'x': 0.77,'y': -0.77,'z': 0.325 },'size': { 'length': 0.06,'width': 0.06,'height': 0.65 },'orientation': { 'w': 1 },'color': { 'r': 255,'g': 222,'b': 173 } },
{ 'id': 'table','pos': { 'z': 0.7 },'size': { 'length': 1.6,'width': 1.6,'height': 0.1 },'orientation': { 'w': 1 },'color': { 'r': 255,'g': 222,'b': 173 } },
{ 'id': 'binBlue','type': 'BIN','pos': { 'x': -0.34,'y': 0.49,'z': 0.8325 },'size': { 'length': 0.21,'width': 0.3,'height': 0.165 },'orientation': { 'w': 1 },'color': { 'b': 1 } },
{ 'id': 'binRed','type': 'BIN','pos': { 'x': 0.06,'y': 0.49,'z': 0.8325 },'size': { 'length': 0.21,'width': 0.3,'height': 0.165 },'orientation': { 'w': 1 },'color': { 'r': 1 } },
{ 'id': 'binGreen','type': 'BIN','pos': { 'x': 0.46,'y': 0.49,'z': 0.8325 },'size': { 'length': 0.21,'width': 0.3,'height': 0.165 },'orientation': { 'w': 1 },'color': { 'g': 1 } },
{ 'id': 'objectRed1','type': 'BOX','pos': { 'x': 0.5,'y': -0.1,'z': 0.8105 },'size': { 'length': 0.031,'width': 0.062,'height': 0.121 },'orientation': { 'z': 0.382683,'w': 0.92388 },'color': { 'r': 1 } },
{ 'id': 'objectRed2','type': 'BOX','pos': { 'x': 0.25,'y': -0.2,'z': 0.8105 },'size': { 'length': 0.031,'width': 0.062,'height': 0.121 },'orientation': { 'w': 1 },'color': { 'r': 1 } },
{ 'id': 'objectRed3','type': 'BOX','pos': { 'x': -0.4,'z': 0.819 },'size': { 'length': 0.031,'width': 0.031,'height': 0.138 },'orientation': { 'z': 0.382683,'w': 0.92388 },'color': { 'r': 1 } },
{ 'id': 'objectGreen1','type': 'BOX','pos': { 'x': 0.45,'y': -0.3,'z': 0.8105 },'size': {'length':0.031,'width':0.062,'height':0.121},'orientation': { 'z': 0.382683,'w': 0.92388 },'color': { 'g': 1 } },
{ 'id': 'objectGreen2','type': 'BOX','pos': { 'x': -0.45,'y': -0.2,'z': 0.8105 },'size': {'length':0.031,'width':0.031,'height':0.138},'orientation': { 'z': 1,'w': 0.92388 },'color': { 'g': 1 } },
{ 'id': 'objectGreen3','type': 'BOX','pos': { 'x': 0.1,'y': -0.3,'z': 0.819 },'size': {'length':0.031,'width':0.062,'height':0.121},'orientation': { 'z': 0.382683,'w': 0.92388 },'color': { 'g': 1 } },
{ 'id': 'objectBlue1','type': 'BOX','pos': { 'x': 0.25,'y': -0.4,'z': 0.8105 },'size': { 'length': 0.031,'width': 0.062,'height': 0.121 },'orientation': { 'z': 0.382683,'w': 0.92388 },'color': { 'b': 1 } },
{ 'id': 'objectBlue2','type': 'BOX','pos': { 'x': -0.3,'y': -0.3,'z': 0.8105 },'size': { 'length': 0.031,'width': 0.062,'height': 0.121 },'orientation': { 'z': 0.382683,'w': 0.92388 },'color': { 'b': 1 } },
{ 'id': 'objectBlue3','type': 'BOX','pos': { 'x': 0.4,'z': 0.819 },'size': { 'length': 0.031,'width': 0.031,'height': 0.138 },'orientation': { 'z': 0.382683,'w': 0.92388 },'color': { 'b': 1 } },
{ 'id': 'arm','type': 'ARM','pos': { 'z': 0.75 },'size': { },'orientation': { 'w': 1 },'color': { 'r': 1.00,'g': 1.00,'b': 1.00 } }
] }
<launch>
<node pkg="ccf" type="dummy_rag_connector_b" name="dummy_rag_connector_b_1" output="screen">
<rosparam param="/ccf/place_b_prefix">place-b-1</rosparam>
</node>
</launch>
<launch>
<node pkg="ccf" type="dummy_rag_connector_b" name="dummy_rag_connector_b_2" output="screen">
<rosparam param="/ccf/place_b_prefix">place-b-2</rosparam>
</node>
</launch>
<launch>
<node pkg="ccf" type="dummy_cgv" name="my_dummy_cgv" output="screen" />
</launch>
<launch>
<arg name="connection_address" default="tcp://*:6576" />
<arg name="client_controllers" default="[]" />
<node pkg="ccf" type="dummy_cgv_controller" name="my_dummy_cgv_controller" output="screen">
<param name="connection_address" type="string" value="$(arg connection_address)" />
<param name="client_controllers" type="yaml" value="$(arg client_controllers)" />
</node>
</launch>
<launch>
<node pkg="ccf" type="dummy_cgv" name="my_dummy_cgv" output="screen" />
<include file="$(find ccf)/launch/cleaning/cleaning_dummy_controller.launch" />
</launch>
<launch>
<node pkg="ccf" type="dummy_cgv" name="my_dummy_cgv" output="screen" />
<node pkg="ccf" type="dummy_cgv_controller" name="main_controller" output="screen">
<param name="connection_address" type="string" value="tcp://*:6576" />
<param name="client_controllers" type="yaml" value="['tcp://127.0.0.1:6586']" />
</node>
<node pkg="ccf" type="dummy_cgv_controller" name="client_controller" output="screen">
<param name="connection_address" type="string" value="tcp://*:6586" />
<param name="client_controllers" type="yaml" value="[]" />
</node>
</launch>
<launch>
<include file="$(find ccf)/launch/cleaning/_simulation_setup.launch"/>
<!--<node pkg="ccf" type="dummy_cgv" name="my_dummy_cgv" output="screen" />-->
<node pkg="ccf" type="moveit_cgv_controller" name="main_controller" output="screen">
<param name="connection_address" type="string" value="tcp://*:6576" />
<param name="client_controllers" type="yaml" value="['tcp://127.0.0.1:6586']" />
</node>
<node pkg="ccf" type="dummy_cgv_controller" name="client_controller" output="screen">
<param name="connection_address" type="string" value="tcp://*:6586" />
<param name="client_controllers" type="yaml" value="[]" />
</node>
</launch>
<launch>
<arg name="robot_ip" default="172.31.1.13" />
<arg name="load_gripper" default="true" />
<arg name="connection_address" default="tcp://*:6576" />
<arg name="client_controllers" default="[]" />
<include file="$(find ccf)/launch/cleaning/_robot_setup.launch" >
<arg name="robot_ip" value="$(arg robot_ip)" />
<arg name="load_gripper" value="$(arg load_gripper)"/>
</include>
<node pkg="ccf" type="moveit_cgv_controller" name="moveit_cgv_controller_instance" output="screen" >
<param name="connection_address" type="string" value="$(arg connection_address)" />
<param name="client_controllers" type="yaml" value="$(arg client_controllers)" />
</node>
</launch>
\ No newline at end of file
<launch>
<node pkg="ccf" type="dummy_cgv" name="my_dummy_cgv" output="screen" />
<include file="$(find ccf)/launch/cleaning/cleaning_robot_controller.launch" />
</launch>
<launch>
<include file="$(find ccf)/launch/cleaning/_simulation_setup.launch"/>
<!--<node pkg="ccf" type="dummy_cgv" name="my_dummy_cgv" output="screen" />-->
<node pkg="ccf" type="dummy_cgv_controller" name="main_controller" output="screen">
<param name="connection_address" type="string" value="tcp://*:6576" />
<param name="client_controllers" type="yaml" value="['tcp://127.0.0.1:6586']" />
</node>
<node pkg="ccf" type="moveit_cgv_controller" name="client_controller" output="screen">
<param name="connection_address" type="string" value="tcp://*:6586" />
<param name="client_controllers" type="yaml" value="[]" />
</node>
</launch>
<launch>
<arg name="connection_address" default="tcp://*:6576" />
<arg name="client_controllers" default="[]" />
<include file="$(find ccf)/launch/cleaning/_simulation_setup.launch"/>
<node pkg="ccf" type="moveit_cgv_controller" name="moveit_cgv_controller_instance" output="screen" >
<param name="connection_address" type="string" value="$(arg connection_address)" />
<param name="client_controllers" type="yaml" value="$(arg client_controllers)" />
</node>
</launch>
\ No newline at end of file
<launch>
<node pkg="ccf" type="dummy_cgv" name="my_dummy_cgv" output="screen" />
<include file="$(find ccf)/launch/cleaning/cleaning_simulation.launch" />
</launch>
......@@ -34,6 +34,4 @@
<node pkg="ccf" type="scene_controller" name="scene_controller_instance" output="screen" />
<rosparam file="$(find ccf)/config/config.yaml" command="load" />
</launch>
\ No newline at end of file
......@@ -13,6 +13,4 @@
<node pkg="ccf" type="scene_controller" name="scene_controller_instance" output="screen" />
<rosparam file="$(find ccf)/config/config.yaml" command="load" />
</launch>
\ No newline at end of file
......@@ -48,12 +48,12 @@ message Object {
Color color = 6;
}
// the scene is stored within the ROS side and sent to the CGV framework
// the scene is stored within the ROS side and sent to clients
message Scene {
repeated Object objects = 1;
}
// the selection is done by the CGV framework and sent to ROS
// the selection is done by a client and sent to ROS
message Selection {
string id = 1; // the id corresponds to an id of an Object in a Scene
}
......
#!/bin/bash
rostopic pub -1 /scene_config/collision_table std_msgs/String -f `rospack find ccf`/config_table.yaml
sleep 3
rostopic pub -1 /scene_config/collision_bin std_msgs/String -f `rospack find ccf`/config_bins.yaml
sleep 3
rostopic pub -1 /scene_config/collision_objects std_msgs/String -f `rospack find ccf`/config_objects_full.yaml
#!/bin/bash
rostopic pub -1 /scene_config/collision_table std_msgs/String -f `rospack find ccf`/config_table.yaml
sleep 3
rostopic pub -1 /scene_config/collision_bin std_msgs/String -f `rospack find ccf`/config_bin.yaml
sleep 3
rostopic pub -1 /scene_config/collision_objects std_msgs/String -f `rospack find ccf`/config_objects.yaml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment