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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include <moveit_visual_tools/visual_tools.h>
00040
00041 #ifndef BAXTER_PICK_PLACE__CUSTOM_ENVIRONMENT_
00042 #define BAXTER_PICK_PLACE__CUSTOM_ENVIRONMENT_
00043
00044 namespace baxter_pick_place
00045 {
00046
00047
00048 static const std::string SUPPORT_SURFACE1_NAME = "monitor";
00049 static const std::string SUPPORT_SURFACE2_NAME = "desk";
00050 static const std::string SUPPORT_SURFACE3_NAME = "table";
00051 static const std::string WALL1_NAME = "back_wall";
00052 static const std::string WALL2_NAME = "right_wall";
00053 static const std::string WALL3_NAME = "left_wall";
00054
00055
00056 static const double TABLE_HEIGHT = 0.818;
00057
00058 static const double TABLE_WIDTH = 0.87;
00059 static const double TABLE_DEPTH = 0.44;
00060 static const double TABLE_X = 0.83;
00061 static const double TABLE_Y = 0.15;
00062
00063
00064 static const double OBJECT_SIZE = 0.04;
00065
00066 void createEnvironment(moveit_visual_tools::VisualToolsPtr visual_tools_)
00067 {
00068 visual_tools_->cleanupCO(SUPPORT_SURFACE1_NAME);
00069 visual_tools_->cleanupCO(SUPPORT_SURFACE2_NAME);
00070 visual_tools_->cleanupCO(WALL1_NAME);
00071 visual_tools_->cleanupCO(WALL2_NAME);
00072 visual_tools_->cleanupCO(WALL3_NAME);
00073
00074
00075
00076
00077
00078 visual_tools_->publishCollisionWall(-0.55, 0, 0, 2.2, WALL1_NAME);
00079 visual_tools_->publishCollisionWall(0.05, -1.1, M_PI/2, 2.0, WALL2_NAME);
00080 visual_tools_->publishCollisionWall(0.05, 1.1, M_PI/2, 2.0, WALL3_NAME);
00081
00082
00083 visual_tools_->publishCollisionTable(0.78, -0.8, 0, 0.4, 1.4, 0.47, SUPPORT_SURFACE1_NAME);
00084 visual_tools_->publishCollisionTable(0.78, -0.45, 0, 0.4, 0.7, 0.47, SUPPORT_SURFACE2_NAME);
00085 visual_tools_->publishCollisionTable(TABLE_X, TABLE_Y, 0, TABLE_WIDTH, TABLE_HEIGHT, TABLE_DEPTH, SUPPORT_SURFACE3_NAME);
00086 }
00087
00088 double getTableHeight(double floor_offset)
00089 {
00090 return TABLE_HEIGHT + floor_offset + OBJECT_SIZE / 2;
00091 }
00092
00093 void getTableWidthRange(double &y_min, double &y_max)
00094 {
00095 y_min = TABLE_Y - TABLE_WIDTH / 2;
00096 y_max = TABLE_Y + TABLE_WIDTH / 2;
00097 }
00098
00099 void getTableDepthRange(double &x_min, double &x_max)
00100 {
00101 x_min = TABLE_X - TABLE_DEPTH / 2;
00102 x_max = TABLE_X + TABLE_DEPTH / 2;
00103 }
00104
00105 }
00106
00107 #endif