Class: Roby::Pos::Euler3D

Inherits:
Vector3D show all
Defined in:
lib/roby/state/pos.rb

Overview

This class represents both a position and an orientation

Instance Attribute Summary collapse

Attributes inherited from Vector3D

#x, #y, #z

Instance Method Summary collapse

Methods inherited from Vector3D

#*, #+, #-, #-@, #/, #==, #distance, #distance2d, #length, #null?, #pretty_print, #xyz

Constructor Details

#initialize(x = 0, y = 0, z = 0, yaw = 0, pitch = 0, roll = 0) ⇒ Euler3D

Create an euler position object



95
96
97
98
# File 'lib/roby/state/pos.rb', line 95

def initialize(x = 0, y = 0, z = 0, yaw = 0, pitch = 0, roll = 0)
    super(x, y, z)
    @yaw, @pitch, @roll = yaw, pitch, roll
end

Instance Attribute Details

#pitchObject

The orientation angles



92
93
94
# File 'lib/roby/state/pos.rb', line 92

def pitch
  @pitch
end

#rollObject

The orientation angles



92
93
94
# File 'lib/roby/state/pos.rb', line 92

def roll
  @roll
end

#yawObject

The orientation angles



92
93
94
# File 'lib/roby/state/pos.rb', line 92

def yaw
  @yaw
end

Instance Method Details

#to_sObject

:nodoc:



105
106
107
# File 'lib/roby/state/pos.rb', line 105

def to_s # :nodoc:
    "Euler3D(x=%f,y=%f,z=%f,y=%f,p=%f,r=%f)" % [x,y,z,yaw,pitch,roll]
end

#yprObject

Returns [yaw, pitch, roll]



101
102
103
# File 'lib/roby/state/pos.rb', line 101

def ypr
    [yaw, pitch, roll]
end