本文整理匯總了Python中Plotter.Plotter.addDataToSubplot方法的典型用法代碼示例。如果您正苦於以下問題:Python Plotter.addDataToSubplot方法的具體用法?Python Plotter.addDataToSubplot怎麽用?Python Plotter.addDataToSubplot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Plotter.Plotter
的用法示例。
在下文中一共展示了Plotter.addDataToSubplot方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: position
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import addDataToSubplot [as 別名]
velBIDs2 = [15,16,17]
rorIDs1 = [14,15,16]
rorIDs2 = [5,6,7]
rorNID1 = 17
rorNID2 = 8
"""
First we will fill the two TimedData structures with the same StampedTransforms,
loaded from topic 'rovio/transform' in example.bag.
The indices denote the start column of the position(td1=1, td2=9) and attitude(td1=4, td2=1)
"""
RosDataAcquisition.rosBagLoadTransformStamped('example.bag','/rovio/transform',td1,posIDs1,attIDs1)
RosDataAcquisition.rosBagLoadTransformStamped('example.bag','/rovio/transform',td2,posIDs2,attIDs2)
# Add initial x to plot
plotter1.addDataToSubplot(td1, posIDs1[0], 1, 'r', 'td1In x');
plotter1.addDataToSubplot(td2, posIDs2[0], 1, 'b', 'td2In x');
"""
Apply body transform to the second data set. The column start IDs of position(9) and attitutde(1) have to be provided.
We define the rotation through a rotation vector vCB, the exponential represents the corresponding rotation quaternion qCB.
The translation is defined by the translation vector B_r_BC
"""
vCB = np.array([0.1,0.2,0.32])
qCB = Quaternion.q_exp(vCB)
B_r_BC = np.array([1.1,-0.2,0.4])
td2.applyBodyTransform(posIDs2, attIDs2, B_r_BC, qCB)
print('Applying Body Transform:')
print('Rotation Vector ln(qCB):\tvx:' + str(vCB[0]) + '\tvy:' + str(vCB[1]) + '\tvz:' + str(vCB[2]))
print('Translation Vector B_r_BC:\trx:' + str(B_r_BC[0]) + '\try:' + str(B_r_BC[1]) + '\trz:' + str(B_r_BC[2]))
示例2: Plotter
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import addDataToSubplot [as 別名]
if plotYpr: # Yaw-pitch-roll plotting
plotterYpr = Plotter(-1, [3,1],'Yaw-Pitch-Roll Decomposition',['','','time[s]'],['roll[rad]','pitch[rad]','yaw[rad]'],10000)
if rovioEvaluator.doCov:
plotterYpr.addDataToSubplotMultiple(td_rovio, 'yprSm', [1,2,3], ['r--','r--','r--'], ['','',''])
plotterYpr.addDataToSubplotMultiple(td_rovio, 'yprSp', [1,2,3], ['r--','r--','r--'], ['','',''])
plotterYpr.addDataToSubplotMultiple(td_rovio, 'ypr', [1,2,3], ['r','r','r'], ['','',''])
plotterYpr.addDataToSubplotMultiple(td_vicon, 'ypr', [1,2,3], ['b','b','b'], ['','',''])
if plotRor: # Rotational rate plotting
plotterRor = Plotter(-1, [3,1],'Rotational Rate',['','','time[s]'],['$\omega_x$[rad/s]','$\omega_y$[rad/s]','$\omega_z$[rad/s]'],10000)
plotterRor.addDataToSubplotMultiple(td_rovio, 'ror', [1,2,3], ['r','r','r'], ['','',''])
plotterRor.addDataToSubplotMultiple(td_vicon, 'ror', [1,2,3], ['b','b','b'], ['','',''])
if plotRon: # Plotting rotational rate norm
plotterRon = Plotter(-1, [1,1],'Norm of Rotational Rate',['time [s]'],['Rotational Rate Norm [rad/s]'],10000)
plotterRon.addDataToSubplot(td_rovio, 'ron', 1, 'r', 'rovio rotational rate norm')
plotterRon.addDataToSubplot(td_vicon, 'ron', 1, 'b', 'vicon rotational rate norm')
if plotExt and rovioEvaluator.doExtrinsics: # Extrinsics Plotting
plotterExt = Plotter(-1, [3,1],'Extrinsics Translational Part',['','','time[s]'],['x[m]','y[m]','z[m]'],10000)
if rovioEvaluator.doCov:
plotterExt.addDataToSubplotMultiple(td_rovio, 'extPosSm', [1,2,3], ['r--','r--','r--'], ['','',''])
plotterExt.addDataToSubplotMultiple(td_rovio, 'extPosSp', [1,2,3], ['r--','r--','r--'], ['','',''])
plotterExt.addDataToSubplotMultiple(td_rovio, 'extPos', [1,2,3], ['r','r','r'], ['','',''])
rovioEvaluator.doLeutiEvaluation()
rovioEvaluator.doFeatureDepthEvaluation()
raw_input("Press Enter to continue...")
示例3:
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import addDataToSubplot [as 別名]
if(okvisOutputFile == '/home/michael/datasets/long_trajectory_leutiLynen/aslam/aslam_estimator_output_data.csv'):
q_real = td_okvis.col(okvis_attID[3])
q_im = -td_okvis.cols(okvis_attID[0:3])
td_okvis.setCols(q_real,okvis_attID[0])
td_okvis.setCols(q_im,okvis_attID[1:4])
td_okvis.computeRotationalRateFromAttitude(okvis_attID,okvis_rorID,2,2)
td_okvis.computeNormOfColumns(okvis_rorID,okvis_ronID)
td_okvis.applyTimeOffset(td_vicon.getFirstTime()-td_okvis.getFirstTime())
to = td_okvis.getTimeOffset(okvis_ronID,td_vicon,vicon_ronID)
td_okvis.applyTimeOffset(-to)
td_okvis.cropTimes(td_vicon.getFirstTime(),td_vicon.getLastTime())
td_okvis.computeVelocitiesInBodyFrameFromPostionInWorldFrame(okvis_posID, okvis_velID, okvis_attID)
if plotRon: # Plotting rotational rate norm
if doRovio:
plotterRon.addDataToSubplot(td_rovio, rovio_ronID, 1, 'r', 'rovio rotational rate norm')
plotterRon.addDataToSubplot(td_vicon, vicon_ronID, 1, 'b', 'vicon rotational rate norm')
if doOkvis:
plotterRon.addDataToSubplot(td_okvis, okvis_ronID, 1, 'g', 'okvis rotational rate norm')
if True: # Transform body coordinate frame for better vizualization, TODO: add to config
if doRovio:
td_rovio.applyBodyTransform(rovio_posID, rovio_attID, bodyTransformForBetterPlotRangePos, bodyTransformForBetterPlotRangeAtt)
td_rovio.applyBodyTransformToAttCov(rovio_attCovID, bodyTransformForBetterPlotRangeAtt)
td_rovio.applyBodyTransformToTwist(rovio_velID, rovio_rorID, bodyTransformForBetterPlotRangePos, bodyTransformForBetterPlotRangeAtt)
td_rovio.applyInertialTransform(rovio_posID, rovio_attID, np.zeros(3), np.array([0,0,0,1]))
if doOkvis:
td_okvis.applyBodyTransform(okvis_posID, okvis_attID, bodyTransformForBetterPlotRangePos, bodyTransformForBetterPlotRangeAtt)
td_okvis.applyBodyTransformToTwist(okvis_velID, okvis_rorID, bodyTransformForBetterPlotRangePos, bodyTransformForBetterPlotRangeAtt)
td_okvis.applyInertialTransform(okvis_posID, okvis_attID, np.zeros(3), np.array([0,0,0,1]))