Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <srs_env_model/but_server/plugins/octomap_plugin_tools/testing_polymesh.h>
00029 #include <Eigen/Geometry>
00030 #include <iostream>
00031
00035 srs_env_model::CTestingPolymesh::CTestingPolymesh()
00036 {
00037
00038 }
00039
00043 srs_env_model::CTestingPolymesh::CTestingPolymesh(const tPoint ¢er, const tQuaternion &orientation, const tPoint & size)
00044 {
00045 setAsBox( center, orientation, size );
00046 }
00047
00051 void srs_env_model::CTestingPolymesh::setAsBox(const tPoint ¢er, const tQuaternion &orientation, const tPoint & size)
00052 {
00053
00054 tPoint points[8];
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 points[0][0] = -size[0]/2.0; points[0][1] = -size[1]/2.0; points[0][2] = -size[2]/2.0;
00085 points[1][0] = size[0]/2.0; points[1][1] = -size[1]/2.0; points[1][2] = -size[2]/2.0;
00086 points[2][0] = size[0]/2.0; points[2][1] = size[1]/2.0; points[2][2] = -size[2]/2.0;
00087 points[3][0] = -size[0]/2.0; points[3][1] = size[1]/2.0; points[3][2] = -size[2]/2.0;
00088 points[4][0] = -size[0]/2.0; points[4][1] = -size[1]/2.0; points[4][2] = size[2]/2.0;
00089 points[5][0] = size[0]/2.0; points[5][1] = -size[1]/2.0; points[5][2] = size[2]/2.0;
00090 points[6][0] = size[0]/2.0; points[6][1] = size[1]/2.0; points[6][2] = size[2]/2.0;
00091 points[7][0] = -size[0]/2.0; points[7][1] = size[1]/2.0; points[7][2] = size[2]/2.0;
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 tTransform transform( tTransform::Identity() );
00106 transform *= Eigen::Translation3f( center );
00107 transform *= orientation;
00108
00109
00110
00111
00112 for( int i = 0; i < 8; ++i )
00113 {
00114 points[i] = transform * points[i];
00115
00116
00117
00118 }
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 addPlane( CTestingPlane(points[0], points[1], points[3] ) );
00132
00133
00134 addPlane( CTestingPlane(points[4], points[7], points[5] ) );
00135
00136
00137 addPlane( CTestingPlane(points[0], points[4], points[1] ) );
00138
00139
00140 addPlane( CTestingPlane(points[3], points[2], points[7] ) );
00141
00142
00143 addPlane( CTestingPlane(points[0], points[3], points[4] ) );
00144
00145
00146 addPlane( CTestingPlane(points[1], points[5], points[2] ) );
00147 }
00148
srs_env_model
Author(s): Vit Stancl (stancl@fit.vutbr.cz), Tomas Lokaj, Jan Gorig, Michal Spanel (spanel@fit.vutbr.cz)
autogenerated on Mon Oct 6 2014 08:05:07