Help with map driver

aneves <[email protected]>
Newsgroups gmane.science.robotics.playerstage
Message-ID <[email protected]>
Hi!

I'm developing a gridslam driver for player and i'm stuck with the map
interface messages. when i try to use the MapProxy on my client I get a
segmentation fault i'm following gridmap driver as an example. I'm using
robot-player 2.0.4 and stage 2.0.3 from ubuntu repositories.
What i'm i doing wrong?  Please help, my deadline is aproching...

Thanks in advance

here is my ProcessMessage() (just the map part)

	 // Is it a request for the map info?
  if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
                            PLAYER_MAP_REQ_GET_INFO,
                            this->prov_map_ID) )
  {
    
     map_info.scale=0.3;//map.GetResolution();
    map_info.width=40;//map.Getxmax()-map.Getxmin();
    map_info.height=40;//map.Getymax()-map.Getymin();
    map_info.origin=init_pose;
    
    this->Publish(this->prov_map_ID,
                 resp_queue,
                 PLAYER_MSGTYPE_RESP_ACK,
                 PLAYER_MAP_DATA_INFO,
                 (void*)&map_info,
                 sizeof(player_map_info_t),
		  NULL);
    return(0);
  } 
 // Is it a request for the map data?
  if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
                            PLAYER_MAP_REQ_GET_DATA,
                            this->prov_map_ID) )
  {
    
    map_data.col=0;
    map_data.row=0;
    map_data.width=map.GetSizeX();
    map_data.height=map.GetSizeY();
    
    int si=map_data.width;
    int sj=map_data.height;
    
    for(int j = 0; j < sj; j++)
    {
      for(int i = 0; i < si; i++)
      {
	float p=0;//map.GetProbValue(i,j);
	if (p<=0.001)
	  p=-1;
	else{
	  if (p<0.99)
	   p=0; 
	  else
	   p=1;
	}
	map_data.data[i+j*si]=p;
      }
    }
    
    
    
    
    this->Publish(this->prov_map_ID,
                 resp_queue,
                 PLAYER_MSGTYPE_RESP_ACK,
                 PLAYER_MAP_REQ_GET_DATA,
                 (void*)&map_data,
                 sizeof(player_map_data_t));
             
    puts("Map data sent!");
    return(0); 
  }




-- 
View this message in context: http://old.nabble.com/Help-with-map-driver-tp29571142p29571142.html
Sent from the playerstage-developers mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.