t265_example.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 ## License: Apache 2.0. See LICENSE file in root directory.
4 ## Copyright(c) 2019 Intel Corporation. All Rights Reserved.
5 
6 #####################################################
7 ## librealsense T265 example ##
8 #####################################################
9 
10 # First import the library
11 import pyrealsense2 as rs
12 
13 # Declare RealSense pipeline, encapsulating the actual device and sensors
14 pipe = rs.pipeline()
15 
16 # Build config object and request pose data
17 cfg = rs.config()
18 cfg.enable_stream(rs.stream.pose)
19 
20 # Start streaming with requested config
21 pipe.start(cfg)
22 
23 try:
24  for _ in range(50):
25  # Wait for the next set of frames from the camera
26  frames = pipe.wait_for_frames()
27 
28  # Fetch pose frame
29  pose = frames.get_pose_frame()
30  if pose:
31  # Print some of the pose data to the terminal
32  data = pose.get_pose_data()
33  print("Frame #{}".format(pose.frame_number))
34  print("Position: {}".format(data.translation))
35  print("Velocity: {}".format(data.velocity))
36  print("Acceleration: {}\n".format(data.acceleration))
37 
38 finally:
39  pipe.stop()
static std::string print(const transformation &tf)


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:11