q4torpy.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # @Author: wangpeng@droid.ac.cn
3 # @Date: 2018-12-29 10:38:52
4 # @Last Modified by: wangpeng@droid.ac.cn
5 # @Last Modified time: 2018-12-29 11:33:46
6 import rospy
7 import tf
8 # test1
9 orientation1=[0,0,0.9818,0.1899]
10 orientation2=[0,0,0.991,0.1335]
11 rpy1= tf.transformations.euler_from_quaternion(orientation1)
12 rpy2=tf.transformations.euler_from_quaternion(orientation2)
13 
14 
15 dy1=abs(rpy1[2]-rpy2[2])*180/3.1415926
16 
17 #test2
18 orientation1=[0,0,-0.760734,0.64906]
19 orientation2=[0,0,-0.7435,0.668745]
20 rpy1= tf.transformations.euler_from_quaternion(orientation1)
21 rpy2=tf.transformations.euler_from_quaternion(orientation2)
22 
23 
24 dy2=abs(rpy1[2]-rpy2[2])*180/3.1415926
25 
26 print dy1
27 print dy2
28 print '-----------------------------------'
29 print (dy2+dy1)/2


xbot_tools
Author(s):
autogenerated on Sat Oct 10 2020 03:28:22