ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Jérôme's profile - activity

2018-11-06 07:57:42 -0500 received badge  Taxonomist
2014-10-31 11:56:09 -0500 received badge  Famous Question (source)
2014-07-18 19:02:22 -0500 received badge  Notable Question (source)
2014-06-27 09:27:25 -0500 received badge  Popular Question (source)
2014-06-06 10:08:15 -0500 answered a question How to check the existence of a node in .launch

In addition you can't run two node with the same name, so by the way it's not possible to have two same node running at a time !

2014-06-06 10:06:12 -0500 answered a question ROS msg format specification

The easyiest way, I think, is to write a python script with a callback for your particular message and made your transform by yourself !

2014-06-06 09:40:21 -0500 received badge  Teacher (source)
2014-06-06 06:56:29 -0500 answered a question read information from a file

Why not just use the C++ api to read file ?


#include <fstream>
#include <streambuf>
#include <string>
#include <cerrno>

std::string get_file_contents(const char *filename)
{
  std::ifstream in(filename, std::ios::in | std::ios::binary);
  if (in)
  {
    return(std::string((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>()));
  }
  throw(errno);
}

Check if your file exist, of course it depends also of the content of the file. With a data file like that :

0 1 2 3 4 5 6 7 8

It's works with this piece of code :

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>

int main()
{
  std::ifstream file("test.txt");
  std::vector<int> data;

  int a[3][3];

  std::memset(a, 0, sizeof(a[0][0]) * 3 * 3);

  if(file.is_open())
  {
    for(int i=0;i<3 && file.good() ;i++)
    {
      for(int j=0;j<3 && file.good() ;j++)
      {
        file >> a[i][j];
      }
    }
  }
  else std::cerr<<"File not found !"<<std::endl;

  for(int i=0;i<3;i++)
    for(int j=0;j<3;j++)
      std::cout<<a[i][j]<<" ";

  return 0;
}
2014-06-05 10:34:42 -0500 asked a question Turtlebot gmapping demo very long on hydro

Hello,

I'am trying to use the turtlebot on hydro (all packets up to date). Gmapping need a huge time to update the map, is it a normal behavior ?

This a sceencast example of rviz based on the demo : youtu.be/z-ZeBIad1YI

Thanks for your help !

2014-03-20 15:32:16 -0500 received badge  Notable Question
2014-03-20 15:32:16 -0500 received badge  Famous Question
2013-12-12 16:31:14 -0500 received badge  Famous Question (source)
2013-11-04 02:28:27 -0500 received badge  Popular Question
2013-07-30 17:40:10 -0500 received badge  Notable Question (source)
2013-06-11 22:46:25 -0500 received badge  Popular Question (source)
2013-06-11 05:07:27 -0500 commented question How to use rosbag to take a snapshot of topics ?

Thanks for you answer, I want to keep the bag file format, I know it's possible to develop something to do that, but if it's possible I prefer to use a standard way (like a rosbag record with option) !

2013-06-10 22:26:27 -0500 answered a question How to use rosbag to take a snapshot of topics ?

Thanks for you answer, I want to keep the bag file format, I know it's possible to develop something to do that, but if it's possible I prefer to use a standard way (like a rosbag record with option) !

2013-06-10 06:28:29 -0500 asked a question How to use rosbag to take a snapshot of topics ?

Hello everyone,

I am trying to record a snapshot of topics when I used a button of my joypad. A naive approach consist to specify a topic trigger for rosbag record.

I found something look good in the source code (github.com/ros/ros_comm/blob/groovy-devel/tools/rosbag/src/recorder.cpp) :

if (options_.snapshot)
{
    record_thread = boost::thread(boost::bind(&Recorder::doRecordSnapshotter, this));

    // Subscribe to the snapshot trigger
    trigger_sub = nh.subscribe<std_msgs::Empty>("snapshot_trigger", 100, boost::bind(&Recorder::snapshotTrigger, this, _1));
}

but I don't understand how to use this option !

Maybe someone can help me or suggest another way to capture topics when I want ?

Thanks

best regards