87 Eigen::Affine3d text_pose = Eigen::Affine3d::Identity();
88 text_pose.translation().z() = 4;
89 visual_tools_->publishText(text_pose,
"MoveIt! Visual Tools", rvt::WHITE, rvt::XLARGE,
false);
100 Eigen::Affine3d pose_copy = pose;
101 pose_copy.translation().x() -= 0.2;
102 visual_tools_->publishText(pose_copy, label, rvt::WHITE, rvt::LARGE,
false);
108 for (std::size_t i = 0; i < 5; ++i)
116 for (std::size_t i = 0; i < 5; ++i)
134 double common_angle =
M_PI * 1.1;
135 double x_offset = -3.0;
139 Eigen::Affine3d robot_pose = Eigen::Affine3d::Identity();
140 robot_pose = robot_pose * Eigen::AngleAxisd(common_angle, Eigen::Vector3d::UnitZ());
141 robot_pose.translation().x() = x_offset;
147 visual_tools_->publishCollisionFloor(-0.5,
"Floor", rvt::GREY);
151 double wall_x = x_offset - 1.0;
152 double wall_y = -1.0;
153 double wall_width = 6.0;
154 double wall_height = 4;
155 visual_tools_->publishCollisionWall(wall_x, wall_y, common_angle, wall_width, wall_height,
"Wall", rvt::GREEN);
159 double table_x = x_offset + 1.0;
162 double table_width = 3;
163 double table_height = 1;
164 double table_depth = 1;
165 visual_tools_->publishCollisionTable(table_x, table_y, table_z, common_angle, table_width, table_height,
166 table_depth,
"Table", rvt::BLUE);
172 for (std::size_t i = 0; i < 5; ++i)
183 Eigen::Affine3d pose1 = Eigen::Affine3d::Identity();
184 Eigen::Affine3d pose2 = Eigen::Affine3d::Identity();
188 double space_between_rows = 0.2;
195 if (file_path ==
"file://")
197 file_path.append(
"/resources/demo_mesh.stl");
199 for (
double i = 0; i <= 1.0; i += 0.1)
202 "Mesh_" + boost::lexical_cast<std::string>(i), file_path,
206 pose1.translation().x() += step;
211 pose1 = Eigen::Affine3d::Identity();
212 y += space_between_rows * 2.0;
213 pose1.translation().y() = y;
214 for (
double i = 0; i <= 1.0; i += 0.1)
216 double size = 0.1 * (i + 0.5);
218 "Block_" + boost::lexical_cast<std::string>(i), size,
223 pose1.translation().x() += step;
228 double cuboid_min_size = 0.05;
229 double cuboid_max_size = 0.2;
230 pose1 = Eigen::Affine3d::Identity();
231 pose2 = Eigen::Affine3d::Identity();
232 y += space_between_rows * 2.0;
233 pose1.translation().y() = y;
234 pose2.translation().y() = y;
235 for (
double i = 0; i <= 1.0; i += 0.1)
238 pose2.translation().x() += i * cuboid_max_size + cuboid_min_size;
239 pose2.translation().y() += (i * cuboid_max_size + cuboid_min_size) / 2.0;
240 pose2.translation().z() += i * cuboid_max_size + cuboid_min_size;
241 visual_tools_->publishCollisionCuboid(pose1.translation(), pose2.translation(),
242 "Rectangle_" + boost::lexical_cast<std::string>(i),
246 pose1.translation().x() += step;
251 double cylinder_min_size = 0.01;
252 double cylinder_max_size = 0.3;
253 pose1 = Eigen::Affine3d::Identity();
254 pose2 = Eigen::Affine3d::Identity();
255 y += space_between_rows * 2.0;
256 pose1.translation().y() = y;
257 pose2.translation().y() = y;
258 for (
double i = 0; i <= 1.0; i += 0.1)
262 pose2.translation().x() += i * cylinder_max_size + cylinder_min_size;
265 visual_tools_->publishCollisionCylinder(pose1.translation(), pose2.translation(),
266 "Cylinder_" + boost::lexical_cast<std::string>(i), radius,
271 pose1.translation().x() += step;
273 pose1 = pose1 * Eigen::AngleAxisd(step * 2 *
M_PI, Eigen::Vector3d::UnitZ());
302 int main(
int argc,
char** argv)
304 ros::init(argc, argv,
"visual_tools_demo");
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
#define ROS_INFO_STREAM_NAMED(name, args)
#define ROS_FATAL_STREAM_NAMED(name, args)
ROSLIB_DECL std::string getPath(const std::string &package_name)
#define ROS_INFO_STREAM(args)
ROSCPP_DECL void spinOnce()