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



119
120
121
122
# File 'lib/roby/state/pos.rb', line 119

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



116
117
118
# File 'lib/roby/state/pos.rb', line 116

def pitch
  @pitch
end

#rollObject

The orientation angles



116
117
118
# File 'lib/roby/state/pos.rb', line 116

def roll
  @roll
end

#yawObject

The orientation angles



116
117
118
# File 'lib/roby/state/pos.rb', line 116

def yaw
  @yaw
end

Instance Method Details

#to_sObject

:nodoc:



129
130
131
# File 'lib/roby/state/pos.rb', line 129

def to_s # :nodoc:
    format("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]



125
126
127
# File 'lib/roby/state/pos.rb', line 125

def ypr
    [yaw, pitch, roll]
end