Skip to content
Snippets Groups Projects
Select Git revision
  • b2f4f3881d89e24b781033b5dff1864e0bcfca0c
  • noetic/main default
2 results

old_ccf

ROS-CGV Connection Component

This ROS package provides a connection between a ROS-based model and the CGV framework. 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 (v3) are exchanged using NNG.

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
  • Get the path to this package
    $ rospack find cgv_connector
  • Generate the documentation
    $ rosdoc_lite <PATH_TO_PACKAGE>
  • You can view the generated files in you browser by opening the generated index.html via CLion in your browser.

CGV Dummy Connector 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 cgv_connector 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_cgv_connector is a mock-up of the ros end of the connection, accepting connections from the CGV framework. When receiving a message on topic /cgv_connector/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_connector and dummy_cgv nodes in two terminals. Both are in the cgv_connector namespace.
    $ rosrun cgv_connector dummy_cgv_connector
    Note that the dummy_cgv tries to connect to the dummy_cgv_connector, so as long as the latter is not running, warnings are logged.
    $ rosrun cgv_connector dummy_cgv
  • Trigger a transmission by publishing a string message to /cgv_connector/send_scene.
    $ rostopic pub -1 /cgv_connector/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_connector

Running the demo

Configuration

  • configure the collision objects:
    rostopic pub -1 /scene_config/collision_objects std_msgs/String -f `rospack find cgv_connector`/config_objects.yaml
  • configure the bin:
    rostopic pub -1 /scene_config/collision_bin std_msgs/String -f `rospack find cgv_connector`/config_bin.yaml
  • configure the table:
    rostopic pub -1 /scene_config/collision_table std_msgs/String -f `rospack find cgv_connector`/config_table.yaml
    A parameter <safety_mode> has to be set in the configuration file to "base" or "safe", where the safe modes a safety-space around the table

Execution

  • pick an object by id: rostopic pub -1 /robot/pick std_msgs/String "objectRed1"
  • place an picked object into a bin by id: rostopic pub -1 /robot/place std_msgs/String "binRed"

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 cgv_connector
    $ docker build --tag cgv_connector .
  • Run the container, exposing the port the receiver listens on, 6576.
    $ docker run -it -p 6576:6576 ros4ceti/cgv:latest roslaunch cgv_connector dummy_cgv_connector.launch
    Run the CGV dummy:
    $ docker run -it --network host ros4ceti/cgv:latest roslaunch cgv_connector dummy_cgv.launch
  • The dummy_cgv_connector now is available and awaits NNG messages at localhost:6576.