Class: Google::Apis::StreetviewpublishV1::Pose
- Inherits:
-
Object
- Object
- Google::Apis::StreetviewpublishV1::Pose
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/streetviewpublish_v1/classes.rb,
generated/google/apis/streetviewpublish_v1/representations.rb,
generated/google/apis/streetviewpublish_v1/representations.rb
Overview
Raw pose measurement for an entity.
Instance Attribute Summary collapse
-
#altitude ⇒ Float
Altitude of the pose in meters above ground level (as defined by WGS84).
-
#heading ⇒ Float
Compass heading, measured at the center of the photo in degrees clockwise from North.
-
#lat_lng_pair ⇒ Google::Apis::StreetviewpublishV1::LatLng
An object representing a latitude/longitude pair.
-
#level ⇒ Google::Apis::StreetviewpublishV1::Level
Level information containing level number and its corresponding name.
-
#pitch ⇒ Float
Pitch, measured at the center of the photo in degrees.
-
#roll ⇒ Float
Roll, measured in degrees.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Pose
constructor
A new instance of Pose.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ Pose
Returns a new instance of Pose
646 647 648 |
# File 'generated/google/apis/streetviewpublish_v1/classes.rb', line 646 def initialize(**args) update!(**args) end |
Instance Attribute Details
#altitude ⇒ Float
Altitude of the pose in meters above ground level (as defined by WGS84).
NaN indicates an unmeasured quantity.
Corresponds to the JSON property altitude
578 579 580 |
# File 'generated/google/apis/streetviewpublish_v1/classes.rb', line 578 def altitude @altitude end |
#heading ⇒ Float
Compass heading, measured at the center of the photo in degrees clockwise
from North. Value must be >=0 and <360.
NaN indicates an unmeasured quantity.
Corresponds to the JSON property heading
585 586 587 |
# File 'generated/google/apis/streetviewpublish_v1/classes.rb', line 585 def heading @heading end |
#lat_lng_pair ⇒ Google::Apis::StreetviewpublishV1::LatLng
An object representing a latitude/longitude pair. This is expressed as a pair
of doubles representing degrees latitude and degrees longitude. Unless
specified otherwise, this must conform to the
WGS84
standard. Values must be within normalized ranges.
Example of normalization code in Python:
def NormalizeLongitude(longitude):
"""Wraps decimal degrees longitude to [-180.0, 180.0]."""
q, r = divmod(longitude, 360.0)
if r > 180.0 or (r == 180.0 and q <= -1.0):
return r - 360.0
return r
def NormalizeLatLng(latitude, longitude):
"""Wraps decimal degrees latitude and longitude to
[-90.0, 90.0] and [-180.0, 180.0], respectively."""
r = latitude % 360.0
if r <= 90.0:
return r, NormalizeLongitude(longitude)
elif r >= 270.0:
return r - 360, NormalizeLongitude(longitude)
else:
return 180 - r, NormalizeLongitude(longitude + 180.0)
assert 180.0 == NormalizeLongitude(180.0)
assert -180.0 == NormalizeLongitude(-180.0)
assert -179.0 == NormalizeLongitude(181.0)
assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Corresponds to the JSON property latLngPair
624 625 626 |
# File 'generated/google/apis/streetviewpublish_v1/classes.rb', line 624 def lat_lng_pair @lat_lng_pair end |
#level ⇒ Google::Apis::StreetviewpublishV1::Level
Level information containing level number and its corresponding name.
Corresponds to the JSON property level
629 630 631 |
# File 'generated/google/apis/streetviewpublish_v1/classes.rb', line 629 def level @level end |
#pitch ⇒ Float
Pitch, measured at the center of the photo in degrees. Value must be >=-90
and <= 90. A value of -90 means looking directly down, and a value of 90
means looking directly up.
NaN indicates an unmeasured quantity.
Corresponds to the JSON property pitch
637 638 639 |
# File 'generated/google/apis/streetviewpublish_v1/classes.rb', line 637 def pitch @pitch end |
#roll ⇒ Float
Roll, measured in degrees. Value must be >= 0 and <360. A value of 0
means level with the horizon.
NaN indicates an unmeasured quantity.
Corresponds to the JSON property roll
644 645 646 |
# File 'generated/google/apis/streetviewpublish_v1/classes.rb', line 644 def roll @roll end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
651 652 653 654 655 656 657 658 |
# File 'generated/google/apis/streetviewpublish_v1/classes.rb', line 651 def update!(**args) @altitude = args[:altitude] if args.key?(:altitude) @heading = args[:heading] if args.key?(:heading) @lat_lng_pair = args[:lat_lng_pair] if args.key?(:lat_lng_pair) @level = args[:level] if args.key?(:level) @pitch = args[:pitch] if args.key?(:pitch) @roll = args[:roll] if args.key?(:roll) end |