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

Dimitri Schachmann's profile - activity

2023-04-29 03:49:51 -0500 received badge  Nice Answer (source)
2020-09-18 02:52:18 -0500 received badge  Good Answer (source)
2020-04-16 15:12:19 -0500 received badge  Good Question (source)
2019-05-20 02:01:03 -0500 received badge  Guru (source)
2019-04-29 15:03:00 -0500 received badge  Great Answer (source)
2019-03-07 09:05:11 -0500 received badge  Nice Answer (source)
2019-01-08 08:54:25 -0500 marked best answer Do topic callbacks and timer callbacks run in the same thread?

The title says it all actually. I wonder whether I need to protect my subscription callbacks from my timer callbacks with a mutex:

eventSubscriber = nh.subscribe("my_topic", 1, &MyNodeClass::topicCallback, this);
timer           = nh.createTimer(my_period_, boost::bind(&MyNodeClass::timerCallback, this, _1));

Can topicCallback and timerCallback be executed in parallel?

2018-11-07 03:33:48 -0500 received badge  Nice Question (source)
2018-10-31 02:18:14 -0500 received badge  Good Question (source)
2018-03-22 11:53:55 -0500 received badge  Nice Question (source)
2018-03-08 00:30:20 -0500 received badge  Nice Answer (source)
2018-01-29 05:57:13 -0500 received badge  Good Answer (source)
2017-11-08 02:45:23 -0500 received badge  Famous Question (source)
2017-09-11 12:33:38 -0500 marked best answer How to set and access local parameters when launching a nodelet?

I know how to set and read local a parameter using a plain node with

"_param:=value"

on the command line and

string value;
ros::param::get("~param", value)

To get the value in the code. But all my attempts to do so with a nodelet fail.

I need to add a local parameter to a nodelet I start. I though I need to add it to the my_argv parameter:

nodelet::M_string remappings;
nodelet::V_string my_argv;
my_argv.push_back("_param:=foo");
manager.load("NodeletName", "my_namespace/NodeletClassName", remappings, my_argv);

And in the nodelet, after onInit() in some callback I have:

std::string param;
ros::param::get("~param", param);
std::cout << "param = " << param << "." << std::endl;

Which prints param = .. I also tried getPrivateNodeHandle().getParam("param", param) with no success.

I guess I'm doing it completely wrong?

The background is, that I want to start load multiple nodelets of the same type but with different configurations. Perhaps there is some other canonical way for that?

2017-06-13 09:15:43 -0500 commented answer While using message_filters to do the time synchronization,but it cannot enter into the callback function

Just make a normal C++ class. This is not ROS specific then.

2017-02-01 06:23:02 -0500 received badge  Nice Answer (source)
2017-01-23 04:25:12 -0500 marked best answer build and run only one rostest

I have

add_rostest_gtest(TestClassA test/ClassA.test src/test/TestClassA.cpp)
add_rostest_gtest(TestClassB test/ClassB.test src/test/TestClassB.cpp)

and I want to build and execute just TestClassB and nothing else. I already know how to limit this to only that package:

catkin run_tests --no-deps my_package

But this still builds all the unit tests in my_package. Also every other time I get:

IOError: cannot create test results directory [/home/.../my_package]. Please check permissions.

So is there a way to build the tests but not to run them, and is there a way to build just one test?

2017-01-07 11:51:02 -0500 received badge  Notable Question (source)
2017-01-04 02:25:08 -0500 received badge  Famous Question (source)
2016-11-03 09:18:19 -0500 answered a question I want to use a c library for a piece of c code in a ros node

"undefined reference" is a linker error, so it means that it does not find your *.so file, which is not surprising, since it does not search in the "include" directory for it (it's only for headers!)

You need to make the link directories known in your CMake:

https://cmake.org/cmake/help/v3.0/com...

So before adding your node target put

link_directories(/path/where/your/so/lies)

into your CMakeLists.txt

But just the directory patch. without the *.so file.

As an alternative you can specify it at runtime (just to try it out). Before launching your node, run in the shell:

export LD_LIBRARY_PATH=/path/where/your/so/lies

You need to run it every time you open a new shell.

2016-10-14 09:33:44 -0500 commented question I need some orientation about ROS

I have no real answer for you and I have never tried ROSJava, but as far as I see it ROSJava does not come even close to C++ and Python in terms of available packages. While there is plenty of documentation and tutorials for c++ and python, for ROSJava there is very little.

2016-10-14 09:25:05 -0500 commented question Convert raw depth data from depth image to meters (Kinect v2)
2016-10-14 04:28:31 -0500 commented question May I run Parameter Server separated?

May I ask what you would gain from running them separatly?

2016-10-14 04:27:38 -0500 answered a question May I run Parameter Server separated?

I'm no expert and it's hard to prove a negative, but I think it is not possible. I conclude so by briefly examining the source code for rosmaster and rosparam:

As far as I see there is no server code in the rosparam implementation, but just the dictionary logic. The server stuff is in the rosmaster code. See Line 324.

2016-09-05 06:22:29 -0500 received badge  Guru (source)
2016-09-05 06:22:29 -0500 received badge  Great Answer (source)
2016-08-30 05:18:42 -0500 commented question how to change the value in the callback fonction of subscriber

could you please format your so it gets displayed properly here? I think you need to enclose code with ```

2016-08-29 05:29:20 -0500 commented question Extract rectified images from bag file with image_raw

please have a look at this question and answers: http://answers.ros.org/question/12687...

2016-08-29 05:10:54 -0500 commented question Extract rectified images from bag file with image_raw

What is the camera_info_file parameter? I don't see it int the image_proc documentation.

2016-08-26 02:51:49 -0500 answered a question How do we set the parameters for any existing package

Try:

rosrun pocketsphinx recognizer.py queue_size:=17

substitute 17 for your desired queue size.

2016-08-25 03:45:01 -0500 received badge  Famous Question (source)
2016-08-24 05:34:52 -0500 commented answer Several Images in one msg, How can I do it?

To see printf or cout output, you need to add output="screen" to your node tag in your launch file. What I do instead is just use ROS_ERROR_STREAM("This is debug text. Value of foo is " << foo);

2016-08-23 05:06:23 -0500 commented question Convert a Video to a Rosbag

Or you could do it with python. First you figure out how you can iterate over your images with OpenCV, then use cv_bridge to create the ROS message of type sensor_msgs/Image and then use the rosbag API to write to a bag file. http://wiki.ros.org/rosbag/Code%20API

2016-08-23 05:03:21 -0500 commented question How do I make nodelet manager as fast as the individual nodes?

How did you measure the fact, that they are slower? When you open up htop do you see them running in separate threads?

2016-08-22 07:09:13 -0500 commented answer How to increase the rate of broadcasting

or use a Timer callback.

2016-08-19 09:02:32 -0500 commented question Several Images in one msg, How can I do it?

Also check whether there is some data on those topics. rostopic echo --noarr /republished/usb_cam/image_raw//republished/bb2/triclops/left/image_raw

2016-08-19 09:01:41 -0500 commented question Several Images in one msg, How can I do it?

I also find the names of the topics you subscribe to rather strange. run rostopic list and check whether it outputs those same topic name exactly (slashes matter).

2016-08-19 08:58:07 -0500 commented question Several Images in one msg, How can I do it?

can you put some std::cout just before ros::spinOnce() to confirm that it gets called?

2016-08-19 07:23:53 -0500 answered a question Several Images in one msg, How can I do it?

The problem is, that you never call ros::spin or ros::spinOnce.

Try replacinggtk_main(); with

auto t = std::thread([&]() {
    ros::spin();
});

gtk_main();

// clean up the thread
if (t.joinable()) {
    t.join();
}

That's needs at least c++11, otherwise you need to figure some other syntax for running ros::spin() in it's own thread.

Basically gtk and ros both need a dedicated thread to loop and process events. Pay attention on racing conditions between the two threads!

2016-08-19 02:43:07 -0500 answered a question ROS Consolor Color Print

It looks like the colors are #define d here: https://github.com/ros/ros_comm/blob/...

I took just a brief glance and did not see any option for runtime configuration. Time to fork? :p

Or you could pipe the output to sed and replace the colors with a clever regex.

2016-08-19 02:37:09 -0500 commented question Nodelet disappears with no message

Could this be your issue? http://answers.ros.org/question/9700/...