Skip to content
Browse files

delete rosruby_common

  • Loading branch information...
1 parent 957bf60 commit f90cc45e85491fa7bdccd0490a40c40a9de89ada @OTL committed May 25, 2012
View
3 rosruby_common/rosruby_tf/lib/tf.rb
@@ -1,3 +0,0 @@
-require 'tf/transform.rb'
-require 'tf/broadcaster.rb'
-
View
63 rosruby_common/rosruby_tf/lib/tf/transformer.rb
@@ -1,63 +0,0 @@
-#
-#
-#
-module Tf
-
- class Transform
-
- def initialize(frame_id, pos, rot, parent)
- @frame_id = frame_id
- @parent = parent
- @pos = pos
- @rot = rot
- end
-
- def to_s
- @frame_id
- end
-
- def get_path(target)
- target_path = target.find_root
- self_path = self.find_root
- if target_path.last == self_path.last
- while target_path.last == self_path.last
- root = target_path.last
- target_path.pop
- self_path.pop
- end
- self_path + [root] + target_path.reverse
- else
- nil
- end
- end
-
- def find_root(path=[])
- if not @parent
- path.push(self)
- else
- @parent.find_root(path.push(self))
- end
- end
-
- def is_connected?(target)
- target_path = target.find_root
- self_path = self.find_root
- target_path.last == self_path.last
- end
-
- def get_transform_to(target)
- path = get_path(target)
- if path
- path.each do |trans|
- end
- else
- nil
- end
- end
- end
-
- class Transformer
-
- end
-
-end
View
37 rosruby_common/rosruby_tf/test/test_transformer.rb
@@ -1,37 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'ros'
-ROS::load_manifest("rosruby_tf")
-
-require 'test/unit'
-require 'tf/transformer'
-
-
-class TestTransformer < Test::Unit::TestCase
- def setup
- # root --- frame1 ---- frame2
- # | |
- # | -- frame3
- # -- framea ---- frameb
- @root = Tf::Transform.new('/root', [0, 0, 0], [0, 0, 0, 1], nil)
- @frame1 = Tf::Transform.new('/frame1', [1, 0, 0], [0, 0, 0, 1], @root)
- @frame2 = Tf::Transform.new('/frame2', [1, 0, 0], [0, 0, 0, 1], @frame1)
- @frame3 = Tf::Transform.new('/frame3', [1, 0, 0], [0, 0, 0, 1], @frame1)
- @framea = Tf::Transform.new('/framea', [1, 0, 0], [0, 0, 0, 1], @root)
- @frameb = Tf::Transform.new('/frameb', [1, 0, 0], [0, 0, 0, 1], @framea)
- end
-
- def test_root
- assert_equal([@frame3, @frame1, @root], @frame3.find_root)
- assert_equal([@frame2, @frame1, @root], @frame2.find_root)
- assert_equal([@frame1, @root], @frame1.find_root)
- assert_equal([@root], @root.find_root)
- end
-
- def test_path
- assert_equal([@framea, @root, @frame1, @frame3], @framea.get_path(@frame3))
- path = @frame2.get_path(@frame3)
- assert_equal([@frame2, @frame1, @frame3], @frame2.get_path(@frame3))
- end
-
-end

0 comments on commit f90cc45

Please sign in to comment.
Something went wrong with that request. Please try again.