Skip to content

Commit

Permalink
initial commit of new buoy-task
Browse files Browse the repository at this point in the history
  • Loading branch information
deshalb committed May 23, 2012
0 parents commit 22092dd
Show file tree
Hide file tree
Showing 10 changed files with 2,052 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
templates/*
.orogen/*
*~
.*.swp
build/*

*autobuild-stamp

9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PROJECT(buoy)
cmake_minimum_required(VERSION 2.6)

SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/.orogen/config")
INCLUDE(buoyBase)

# FIND_PACKAGE(KDL)
# FIND_PACKAGE(OCL)

1,417 changes: 1,417 additions & 0 deletions Doxyfile.in

Large diffs are not rendered by default.

249 changes: 249 additions & 0 deletions buoy.orogen
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
name "buoy"
# Optionally declare the version number
# version "0.1"

# If new data types need to be defined, they have to be put in a separate C++
# header, and this header will be loaded here
# import_types_from "buoy_detectorType.hpp"

# If the component/deployments use data types that are defined in other oroGen
# projects, these projects should be imported there as well.
using_library "opencv"
#using_library "eigen2"
using_library "frame_helper"
using_library "visual_detectors"
import_types_from "base"
import_types_from "avalon_base"

task_context "Survey" do
# --------------------------------------------------------------------------
# BUOY_DETECTED: found a buoy within a sequence of frames
# BUOY_LOST: lost the buoy over a sequence of frames
# --------------------------------------------------------------------------
states("BUOY_SEARCH", "BUOY_DETECTED", "BUOY_LOST", "RE_SEARCHING_BUOY", "BUOY_ARRIVED", "STRAFING",
"STRAFE_FINISHED", "STRAFE_ERROR", "MOVING_TO_CUTTING_DISTANCE", "CUTTING",
"CUTTING_SUCCESS", "CUTTING_ERROR")

# --------------------------------------------------------------------------
# I n p u t s
# --------------------------------------------------------------------------
input_port("frame", ro_ptr("base::samples::frame::Frame")).
doc("current frame given from a camera on which a buoy should be detected")
input_port("orientation_samples", "base::samples::RigidBodyState").
doc 'Vehicle orientation with depth'
input_port("force_cutting", "bool").
doc("if true the task will direktly go tu STRAFE_FINISHED-state")

# --------------------------------------------------------------------------
# O u t p u t s
# --------------------------------------------------------------------------
output_port("buoy", "/avalon/feature/Buoy").
doc("feature data of a buoy with the highest probability in frame")

output_port("relative_position", "/base/AUVPositionCommand").
doc("relative position of the buoy in frame")

output_port("strafed_angle", "double").
doc("the angle that was strafed in pi...")

# --------------------------------------------------------------------------
# P r o p e r t i e s
# --------------------------------------------------------------------------
# property("hue_low", "int", 56).
# doc("set low hue value to recude color space")

# property("hue_high", "int", 200).
# doc("set high hue value to reduce color space")

property("max_buoy_distance", "double", 2.0).
doc("maximum buoy distance in m")

property("buoy_radius", "double", 0.05). #bei boye mit d=25cm ist wert von 0.05 realistisch. wieso?
doc("radius of the buoy in m")

property("houghTh", "int", 25).
doc("Hough threshold.")

property("hValue", "int", 55).
doc("Buoy hue value.")

property("strafe_intensity", "double", -0.8).
doc("intensity and direction of strafing (negative is right).");

property("vValue", "int", 40).
doc("Buoy hue value.")

property("sValue", "int", 95).
doc("Buoy saturation value.")

property("steps", "int", 5).
doc("Step size to detect V value.")

property("edgeTh", "int", 35).
doc("Buoy V value.")

property("run_in_simulation", "bool", 0).
doc("shows if the task runs in simulation or not.")

property("debug_gui", "bool", true).
doc("Sets test mode.")

property("buoy_timeout", "int", 20).
doc("number of frames a buoy is not detected in order to set BUOY_LOST")

property("lost_timeout", "int", 20).
doc("timeout how long it takes to change state from RE_SEARCHING_BUOY to BUOY_LOST.")

property("filter_timeout", "double", 1.5).
doc("the time in s how long a buoy of the past is noticed by the filter.")

property("good_y_z", "double", 0.2).
doc("for detecting if the buoy is in a good position to strafe.")

property("good_x", "double", 0.3).
doc("for detecting if the buoy is in a good position to strafe.")

property("buoy_depth", "double", -1.0).
doc("the absolute high of the buoy in the water.")

property("headingFactor", "double", 1.0).
doc("factor multiplied for heading")

property("headingModulation", "double", 0.0).
doc("pre-heading for strafing")

property("maxX", "double", 0.2).
doc("maximum x value for strafing")
property("cutting_time", "int", 53).
doc("time for the cutting-action in seconds.")
property("cutting_hight", "double", -0.25)
doc("how much higher should he go to cut the buoy.")

property("strafe_angle", "double", 0.95)
doc("the angle that is to strafe around the buoy and bagwards. it has to be 0<x<1, where the angle is x*pi where 1*pi=180°.")

property("strafe_around", "bool", 0)
doc("if it is true the strafe_angle will be ignored and the auv will strafe in a hole cycle around the buoy.")

property("cutting_wait_time", "int", 60)
doc("time in seconds to wait in moving_to_cutting_distance before cutting.")

port_driven("frame")
end

task_context "Detector" do
# --------------------------------------------------------------------------
# BUOY_DETECTED: found a buoy within a sequence of frames
# BUOY_LOST: lost the buoy over a sequence of frames
# --------------------------------------------------------------------------
states("BUOY_SEARCH", "BUOY_DETECTED", "BUOY_LOST", "RE_SEARCHING_BUOY", "BUOY_ARRIVED", "STRAFING",
"STRAFE_FINISHED", "STRAFE_ERROR", "MOVING_TO_CUTTING_DISTANCE", "CUTTING",
"CUTTING_SUCCESS", "CUTTING_ERROR")

# --------------------------------------------------------------------------
# I n p u t s
# --------------------------------------------------------------------------
input_port("frame", ro_ptr("base::samples::frame::Frame")).
doc("current frame given from a camera on which a buoy should be detected")
input_port("orientation_samples", "base::samples::RigidBodyState").
doc 'Vehicle orientation with depth'
input_port("force_cutting", "bool").
doc("if true the task will direktly go tu STRAFE_FINISHED-state")

# --------------------------------------------------------------------------
# O u t p u t s
# --------------------------------------------------------------------------
output_port("buoy", "/avalon/feature/Buoy").
doc("feature data of a buoy with the highest probability in frame")

output_port("relative_position", "/base/AUVPositionCommand").
doc("relative position of the buoy in frame")

output_port("strafed_angle", "double").
doc("the angle that was strafed in pi...")

# --------------------------------------------------------------------------
# P r o p e r t i e s
# --------------------------------------------------------------------------
# property("hue_low", "int", 56).
# doc("set low hue value to recude color space")

# property("hue_high", "int", 200).
# doc("set high hue value to reduce color space")

property("max_buoy_distance", "double", 2.0).
doc("maximum buoy distance in m")

property("buoy_radius", "double", 0.05). #bei boye mit d=25cm ist wert von 0.05 realistisch. wieso?
doc("radius of the buoy in m")

property("houghTh", "int", 25).
doc("Hough threshold.")

property("hValue", "int", 55).
doc("Buoy hue value.")

property("strafe_intensity", "double", -0.8).
doc("intensity and direction of strafing (negative is right).");

property("vValue", "int", 40).
doc("Buoy hue value.")

property("sValue", "int", 95).
doc("Buoy saturation value.")

property("steps", "int", 5).
doc("Step size to detect V value.")

property("edgeTh", "int", 35).
doc("Buoy V value.")

property("run_in_simulation", "bool", 0).
doc("shows if the task runs in simulation or not.")

property("debug_gui", "bool", true).
doc("Sets test mode.")

property("buoy_timeout", "int", 20).
doc("number of frames a buoy is not detected in order to set BUOY_LOST")

property("lost_timeout", "int", 20).
doc("timeout how long it takes to change state from RE_SEARCHING_BUOY to BUOY_LOST.")

property("filter_timeout", "double", 1.5).
doc("the time in s how long a buoy of the past is noticed by the filter.")

property("good_y_z", "double", 0.2).
doc("for detecting if the buoy is in a good position to strafe.")

property("good_x", "double", 0.3).
doc("for detecting if the buoy is in a good position to strafe.")

property("buoy_depth", "double", -1.0).
doc("the absolute high of the buoy in the water.")

property("headingFactor", "double", 1.0).
doc("factor multiplied for heading")

property("headingModulation", "double", 0.0).
doc("pre-heading for strafing")

property("maxX", "double", 0.2).
doc("maximum x value for strafing")
property("cutting_time", "int", 53).
doc("time for the cutting-action in seconds.")
property("cutting_hight", "double", -0.25)
doc("how much higher should he go to cut the buoy.")

property("strafe_angle", "double", 0.95)
doc("the angle that is to strafe around the buoy and bagwards. it has to be 0<x<1, where the angle is x*pi where 1*pi=180°.")

property("strafe_around", "bool", 0)
doc("if it is true the strafe_angle will be ignored and the auv will strafe in a hole cycle around the buoy.")

property("cutting_wait_time", "int", 60)
doc("time in seconds to wait in moving_to_cutting_distance before cutting.")

port_driven("frame")
end

16 changes: 16 additions & 0 deletions manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<package>
<description brief="contrains buoy-tasks for sauc-e 2011 and 2012">

</description>
<author>Thomas Grassow/[email protected]</author>
<license></license>
<url>http://</url>
<logo>http://</logo>
<!--
To add any dependencies use the depend tag
<depend package="dummy-dependency-0" />
...
<depend package="dummy-dependency-n-1" />
<depend package="dummy-dependency-n" />
-->
</package>
23 changes: 23 additions & 0 deletions tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated from orogen/lib/orogen/templates/tasks/CMakeLists.txt

include(buoyTaskLib)
ADD_LIBRARY(${BUOY_TASKLIB_NAME} SHARED
${BUOY_TASKLIB_SOURCES})

add_dependencies(${BUOY_TASKLIB_NAME}
regen-typekit)


TARGET_LINK_LIBRARIES(${BUOY_TASKLIB_NAME}
${OrocosRTT_LIBRARIES}
${BUOY_TASKLIB_DEPENDENT_LIBRARIES})
SET_TARGET_PROPERTIES(${BUOY_TASKLIB_NAME}
PROPERTIES LINK_INTERFACE_LIBRARIES "${BUOY_TASKLIB_INTERFACE_LIBRARIES}")

INSTALL(TARGETS ${BUOY_TASKLIB_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/orocos)

INSTALL(FILES ${BUOY_TASKLIB_HEADERS}
DESTINATION include/orocos/buoy)

55 changes: 55 additions & 0 deletions tasks/Detector.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Generated from orogen/lib/orogen/templates/tasks/Task.cpp */

#include "Detector.hpp"

using namespace buoy;

Detector::Detector(std::string const& name, TaskCore::TaskState initial_state)
: DetectorBase(name, initial_state)
{
}

Detector::Detector(std::string const& name, RTT::ExecutionEngine* engine, TaskCore::TaskState initial_state)
: DetectorBase(name, engine, initial_state)
{
}

Detector::~Detector()
{
}



/// The following lines are template definitions for the various state machine
// hooks defined by Orocos::RTT. See Detector.hpp for more detailed
// documentation about them.

// bool Detector::configureHook()
// {
// if (! DetectorBase::configureHook())
// return false;
// return true;
// }
// bool Detector::startHook()
// {
// if (! DetectorBase::startHook())
// return false;
// return true;
// }
// void Detector::updateHook()
// {
// DetectorBase::updateHook();
// }
// void Detector::errorHook()
// {
// DetectorBase::errorHook();
// }
// void Detector::stopHook()
// {
// DetectorBase::stopHook();
// }
// void Detector::cleanupHook()
// {
// DetectorBase::cleanupHook();
// }

Loading

0 comments on commit 22092dd

Please sign in to comment.