示例#1
0
int doSkeletonConversions( struct skeletonHuman * skel )
{
   char filenameBuf[512]={0};

   updateSkeletonAngles(skel);
   printSkeletonHuman(skel);



   if (
        (frames==0) || // In order to refresh the visualization frame 0 is needed
        (broadCastOnly==0) ||
        (broadCastOnly==frames)
       )
   {
   //updateSkeletonAnglesNAO(skel);
   fprintf(stderr,"doSkeletonConversions #%u ",frames);
   snprintf(filenameBuf,512,"skel2D%u.svg",frames);
   if (!skeleton2DEmpty(skel))
   {
    visualize2DSkeletonHuman(filenameBuf,  skel, visualizationScale);
   } else { fprintf(stderr,RED "Won't print out 2D scenes with skeletons for empty 2D skeleton info \n" NORMAL );}



   if (!skeleton3DEmpty(skel))
   {
   snprintf(filenameBuf,512,"skel3D.scene");
   visualize3DSkeletonHuman(filenameBuf,skel,frames);
   } else { fprintf(stderr,RED "Won't print out 3D scenes with skeletons for empty 3D skeleton info \n" NORMAL );}


   if (!skeleton3DEmpty(skel))
   {
    broadcastHTTPSkeleton(skel,"http://127.0.0.1:8080/sk.html?sk=");
   }else { fprintf(stderr,RED "Won't broadcast 3D scenes for empty 3D skeleton info\n" NORMAL );}
   }



//   struct naoCommand nao={0};
   struct skeletonHuman sk={0};

   //setNAOMotorsFromHumanSkeleton( &nao , &sk );
   snprintf(filenameBuf,512,"skel%u.skel",frames);
   //printoutNAOCommand( filenameBuf , &nao );


   usleep(delay*1000);
   cleanSkeleton(skel);
   ++frames;
  return 1;
}
示例#2
0
void SSTask::startTask(const QList<QPolygonF>& polygons)
{
	cleanSkeleton();
	resume();
	PSLGGraph* graph = new PSLGGraph();
	for(int i = 0; i < polygons.size(); i++){
		if(polygons[i].size() <= 1 || polygons[i].boundingRect().isEmpty())
			continue;
		graph->addPolygon(polygons[i], false );
	}
	m_timeIntervalIsZero = property("-Sleep Interval (ms)").toInt() <= 0;
	m_skeleton = new PSLGSSkeleton(graph);
	start();	
}