Go to the documentation of this file.00001 #include <gazebo_test_tools/gazebo_cube_spawner.h>
00002
00003
00004 int main(int argc, char** argv) {
00005 ros::init(argc, argv, "gazebo_cube_spawner");
00006
00007 if (argc < 5)
00008 {
00009 ROS_INFO("Usage: %s <name> [x y z] [frame_id].",argv[0]);
00010 return 0;
00011 }
00012
00013 ros::NodeHandle node;
00014 gazebo_test_tools::GazeboCubeSpawner spawner(node);
00015
00016 ROS_INFO("Running spawn cube once..");
00017
00018 std::string name=argv[1];
00019 float x=0;
00020 float y=0;
00021 float z=0;
00022
00023 std::string frame_id="world";
00024 if (argc>2) x=atof(argv[2]);
00025 if (argc>3) y=atof(argv[3]);
00026 if (argc>4) z=atof(argv[4]);
00027 if (argc>5) frame_id=argv[5];
00028
00029 float dim=0.05;
00030 float mass=0.05;
00031
00032 spawner.spawnCube(name,frame_id,x,y,z,0,0,0,1,dim,dim,dim,mass);
00033 return 0;
00034 }