TBM2 - “Plate Drilling”

From RoCKIn Wiki
Revision as of 20:07, 27 April 2015 by Rockinadmin (Talk | contribs) (Created page with "== Quality control camera == The quality control camera is mounted at the end of the conveyor belt and facing towards the belt. The camera provides an image with a resolution...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Quality control camera

The quality control camera is mounted at the end of the conveyor belt and facing towards the belt. The camera provides an image with a resolution of 640 x 480 pixels.

Quality control camera.jpg


Plates

In this year competition only two different types of plates will be used, namely "unusable" (left plate in the image below) and "faulty" (right plate) plates. Unusable plates are missing the big hole in the center a need to be sorted out, while faulty plates need to be corrected using the drilling machine.

!plates.jpg!


Drilling Machine

!drilling_machine.jpg!


RefBox-Communication

For this task benchmark the robot has to operate or interact with the networked devices in the environment in addition to the referee box, namely:

  • conveyor belt
  • quality control camera
  • drilling machine


The communication between the refbox and the robot during this task benchmarks looks as follows:

1. The robot sends a "BeaconSignal":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/BeaconSignal.proto message at least every second.

2. The robot waits for "BenchmarkState":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/BenchmarkState.proto messages. The robot is suppose to start the task benchmark as soon as _state_ is equal to _RUNNING_. Otherwise, the robot should wait until the value changes from _INIT_ to _RUNNING_.

3. The robot waits for a "Inventory":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/Inventory.proto message from the refbox (which is sent out continuously by the refbox) in order to receive the initial distribution of objects and their locations in the environment. *NOTE:* the inventory will not get updated during a run, i.e. it always reflects the initial situation only.

4. The robot waits for a "Order":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/Order.proto message from the refbox (which is sent out continuously by the refbox) in order to receive the actual task, i.e. where should which object be at the end.

5. While performing the task, the robot has to operate networked devices in the environment. An explanation on the usage of those devices can be below.

6. The task benchmark ends when all objects are at their final location as specified in the "Order":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/Order.proto message.


_+Operating the conveyor belt+_

To start and stop the conveyor belt, a message of type "ConveyorBeltCommand":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/ConveyorBelt.proto has to be sent to the referee box. In order to start the conveyor belt, the variable _command_ needs to be set to _ConveyorBeltRunMode::START_. To stop the belt the variable needs to be set to _ConveyorBeltRunMode::STOP_. An example in C++ can be found here: "https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/tools/rockin-device-ctrl.cpp":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/tools/rockin-device-ctrl.cpp.

Additionally, the referee box sends a status message of type "ConveyorBeltStatus":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/ConveyorBelt.proto indicating whether the belt is moving (_state_ is equal to _ConveyorBeltRunMode::START"_) or not moving (_state_ is equal to _ConveyorBeltRunMode::STOP_).


_+Receiving images from the quality control camera+_

To receive an image from the quality control camera, the robot has to send a request to the referee box in form of an empty "CameraCommand":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/Camera.proto message. According to this request, the referee box will sent back a "CompressedImage":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/CompressedImage.proto message which includes the image data from the camera.

The "CompressedImage":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/CompressedImage.protoo message can be easily transformed into an OpenCV image as follows (C++):

CompressedImage received_image_msg;

std::vector<uchar> buf; cv::Mat compressed_opencv_img;

for(size_t i = 0; i < received_image_msg.data().length(); ++i)
{
   buf.push_back(received_image_msg.data()[i]);

}

cv::imdecode(cv::Mat(buf), CV_LOAD_IMAGE_COLOR, &compressed_opencv_img);


The reveived image message can also be transformed to the equivalent ROS message "CompressedImage":http://docs.ros.org/api/sensor_msgs/html/msg/CompressedImage.html.


_+Operating the drilling machine+_

The drill of the drilling machine will spin continuously, i.e. a robot just needs to command the drill to move down and up. To send such a command, the robot is supposed to send a message of type "DrillingMachineCommand":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/DrillingMachine.proto to the referee box. In order to move down the drill, the variable _command_ needs to be set to _Command::MOVE_DOWN_. To move the drill up again the variable needs to be set to _Command::MOVE_UP_. An example in C++ can be found here: "https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/tools/rockin-device-ctrl.cpp":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/tools/rockin-device-ctrl.cpp.

Additionally, the referee box sends a status message of type "DrillingMachineStatus":https://github.com/mas-group/rockin-refbox/blob/rockin/rockin/msgs/DrillingMachine.proto indicating whether the drill is at the top position (_state_ is equal to _State::AT_TOP_), at the bottom position (_state_ is equal to _State::AT_BOTTOM_), moving down (_state_ is equal to _State::MOVING_DOWN_) or moving up (_state_ is equal to _State::MOVING_UP_). In case of a problem, the _state_ is equal to _State::UNKOWN_.


List of variables to be logged

Additionally, the robot is required to log any relevant sensor data used to perform classification (e.g., images, planned trajectories and replanning, plate condition evaluations before and after drilling, issued drilling commands). This offline data has to be logged on a USB stick which is directly connected to the robot. The offline log may be a rosbag or the corresponding YAML representation, as specified in document:"RoCKIn YAML Data File Specification". Online data has to be sent directly to the referee box.

+Online data:+ No online benchmarking data has to be sent to the referee box during this task benchmark.

+Offline data:+ RoCKIn requires that robots *save some data* when executing the benchmarks. The modalities for this are explained by "this document":http://rm.isr.ist.utl.pt/attachments/624/robot_data.txt. The following are expected ROS topic names and corresponding data types stored in a YAML file or rosbag:

  • image [@sensor_msgs/Image@]
  • base path [@nav_msgs/Path@]
  • tf [@tf/tfMessage@] or [@tf2_msgs/TFMessage@]

+Important!+ Calibration parameters for cameras must be saved. This must be done also for other sensors (e.g., Kinect) that require calibration, if a calibration procedure has been applied instead of using the default values (e.g., those provided by OpenNI).