Skip to content

Commit

Permalink
add rotation speed to buoy on wall
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Lehr committed Oct 2, 2014
1 parent 4292ef2 commit 7a2b75e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions buoy.orogen
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ task_context "ServoingOnWall" do

property("distance_to_buoy", "double", 1)
property("angle_to_wall", "double", 0)
property("heading_step_size", "double", 0.1)

property("aligned_distance", "double", 0.5)

Expand Down
2 changes: 1 addition & 1 deletion scripts/debug_gui/run_log_new.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
exit 1
end
Orocos.run ("buoy_test") do
#Orocos.log_all_ports
# Orocos.log_all_ports
Orocos.conf.load_dir("#{ENV['AUTOPROJ_CURRENT_ROOT']}/bundles/auv/config/orogen/")
detector = Orocos::TaskContext.get "buoy_detector"
log = Orocos::Log::Replay.open(ARGV[0], Typelib::Registry.new)
Expand Down
2 changes: 1 addition & 1 deletion scripts/debug_gui/run_log_new_bottom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

log.bottom_camera.frame.connect_to detector.frame

Orocos.conf.apply(detector, ['bottom_white'])
Orocos.conf.apply(detector, ['bottom_orange'])
detector.configure
detector.start

Expand Down
5 changes: 4 additions & 1 deletion tasks/ServoingOnWall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ void ServoingOnWall::updateHook()
if(buoy.validation > 0.8){
if(last_buoy_validation < 0.8 && state() != BUOY_SERVOING && state() != ALIGNED){
wall_on_buoy_detection = wall;
start_heading = base::getYaw(orientation.orientation);
state(BUOY_SERVOING);
}

double heading_step = base::Angle::normalizeRad(base::getYaw(orientation.orientation) + _heading_step_size.get());

Eigen::Vector3d buoy_rel_pos_in_world = orientation.orientation * buoy.world_coord;
Eigen::Vector3d buoy_offset = orientation.orientation.inverse() * (Eigen::AngleAxisd(wall_on_buoy_detection.wall_angle - (M_PI) + _angle_to_wall.get(), Eigen::Vector3d::UnitZ()) * Eigen::Vector3d(_distance_to_buoy.get(),0,0));
Eigen::Vector3d buoy_offset = orientation.orientation.inverse() * (Eigen::AngleAxisd(heading_step, Eigen::Vector3d::UnitZ()) * Eigen::Vector3d(_distance_to_buoy.get(),0,0));

buoy.world_coord[0] = buoy.world_coord[0] - 0.8;

Expand Down
1 change: 1 addition & 0 deletions tasks/ServoingOnWall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace buoy {

sonar_detectors::Wall wall_on_buoy_detection;
double last_buoy_validation;
double start_heading;


public:
Expand Down

0 comments on commit 7a2b75e

Please sign in to comment.