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

sergey_alexandrov's profile - activity

2023-06-25 11:54:44 -0500 received badge  Favorite Question (source)
2019-12-21 09:11:16 -0500 received badge  Necromancer (source)
2019-10-28 15:38:11 -0500 received badge  Famous Question (source)
2017-12-21 13:43:49 -0500 received badge  Good Question (source)
2016-03-22 20:21:35 -0500 received badge  Enlightened (source)
2016-03-22 20:21:35 -0500 received badge  Good Answer (source)
2016-02-11 10:15:00 -0500 received badge  Great Answer (source)
2015-06-26 08:54:47 -0500 received badge  Good Answer (source)
2015-01-30 05:00:27 -0500 received badge  Nice Answer (source)
2015-01-19 23:33:00 -0500 received badge  Notable Question (source)
2014-12-05 10:11:54 -0500 received badge  Necromancer (source)
2014-11-13 05:51:58 -0500 received badge  Popular Question (source)
2014-09-16 02:55:49 -0500 received badge  Enthusiast
2014-09-02 09:54:19 -0500 asked a question Satisfying build dependencies of a stack

Say I want to build from source a collection of packages united into a stack (like navigation or image_pipline). Such stacks contain multiple packages plus a meta-package named after the stack. In order to build the whole thing, it's sufficient to type e.g. catkin_make --pkg navigation. However, the compilation will fail if some of the packages in the stack have unsatisfied dependencies.

I would expect rosdep install navigation to resolve these dependencies for me (as soon as they are properly stated in package manifests), however in reality it does not do anything because the manifest of navigation meta-package does not contain build_depend tags. I wonder why it is so, and what is the right way to satisfy the dependencies of a stack without going through each package individually.

2014-07-08 06:24:40 -0500 received badge  Famous Question (source)
2014-01-28 17:23:11 -0500 marked best answer Compiling tf or tf2 with -std=gnu++0x

Hello,

I am trying to rosmake a package (modular_cloud_matcher) which forces -std=gnu++0x compiler option. This results in the following error:

/opt/ros/electric/stacks/geometry/tf/include/tf/tf.h:91:44: error: ‘constexpr’ needed for in-class initialization of static data member ‘DEFAULT_CACHE_TIME’ of non-integral type

and a similar one in tf2.

A possible solution is to change in tf.h from

static const double DEFAULT_CACHE_TIME = 10.0;

to

static constexpr double DEFAULT_CACHE_TIME = 10.0;

I suppose, however, this is not the right way to solve the issue, because next update will remove my modification. I am rather new to the ROS community, so I would like to know what should be done in such cases.

2013-10-17 06:37:04 -0500 commented question Roslaunch XML format: is there a DTD?

@mikepurvis No, in the end I decided it is not worth the effort, sorry...

2013-09-29 22:09:30 -0500 received badge  Nice Question (source)
2013-09-20 09:33:37 -0500 received badge  Notable Question (source)
2013-09-20 09:33:37 -0500 received badge  Popular Question (source)
2013-06-10 12:54:35 -0500 commented question Message filter using Approximate time policy. callback function called once..

You may close the question so as to remove it from the "Unanswered" list and improve the overall statistics :)

2013-06-09 03:23:25 -0500 commented question Message filter using Approximate time policy. callback function called once..

Although you did not paste the complete listing, it seems like the sync object is not a member field of your VideoSource class, but rather a local variable (in constructor I guess). If this is the case then sync is destructed as soon as the constructor is executed, which removes the callback.

2013-05-08 04:52:54 -0500 received badge  Necromancer (source)
2013-04-16 05:27:22 -0500 commented question Roslaunch XML format: is there a DTD?

Ha-ha yes, ft=xml is suprisingly useful :) For sure I can create DTD myself, but I just hoped to avoid extra work and also simplify maintenance.

2013-04-16 05:16:56 -0500 received badge  Student (source)
2013-04-16 04:56:31 -0500 asked a question Roslaunch XML format: is there a DTD?

Hi,

I am developing a ROS plugin for Vim and want to add support for editing of roslaunch files. Vim already has a built-in support for omni-completion of XML dialects as soon as the formal definition of a language is provided. So I am wondering does there exist a DTD for the roslaunch XML format?

2013-03-18 00:54:45 -0500 answered a question What parameters are used in PCL's Bilateral Filter?

There are several bilateral filters in PCL:

  1. BilateralFilter, no defaults.
  2. FastBilateralFilter, default is 15.0f spatial width and 0.05f range sigma.
  3. Bilateral filter in KinFu, uses 4.5f spatial width and 0.03f range sigma.
2013-02-16 11:55:17 -0500 answered a question Replacing camera_info messages

You can use the following function to replace all camera info messages in a certain topic with another given camera info message:

def replace_camera_info_messages(bag, topic, camera_info):                  
    import os.path                                                          
    import rosbag                                                           
    orig = os.path.splitext(bag)[0] + '.orig.bag'                           
    os.rename(bag, orig)                                                    
    inbag = rosbag.Bag(orig, 'r')                                           
    outbag = rosbag.Bag(bag, 'w')                                           
    for t, msg, ts in inbag.read_messages():                                
        if t == topic:                                                      
            camera_info.header.seq = msg.header.seq                         
            camera_info.header.stamp = msg.header.stamp                     
            outbag.write(t, camera_info, ts)                                
        else:                                                               
            outbag.write(t, msg, ts)                                        
    inbag.close()                                                           
    outbag.close()
2012-08-16 04:16:01 -0500 received badge  Famous Question (source)
2012-08-16 04:16:01 -0500 received badge  Notable Question (source)
2012-08-15 04:51:28 -0500 answered a question subscribing and publishing

Some publishers are written the way that if there are no subscribers, then they do not publish and also avoid unneeded processing. To my knowledge, Kinect node works this way. It does not compute point clouds from the depth images coming from the sensor unless there are subscribers on the "points" topic. Therefore if you just need to get a point cloud once in a while, subscribing and ignoring messages will incur a lot of superfluous computations.

What may be useful in such cases is ros::topic::waitForMessage(). It waits for a single message to arrive on a topic, possibly with a timeout.

2012-05-08 09:11:48 -0500 received badge  Popular Question (source)
2012-04-11 06:55:21 -0500 answered a question start and stop rosbag within a python script

Seems like

self.p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=True, cwd=dir_save_bagfile)

starts a shell which then starts the program that does the job. One could see it with ps:

$ ps aux | grep record
sergey   17900  0.0  0.0   4272   584 pts/4    S    18:36   0:00 /bin/sh -c rosbag record -O /home/ . . . 
sergey   17901  7.3  0.1 288132  7124 pts/4    Sl   18:36   0:00 record --buffsize 256 -O /home/ . . .

Therefore killing the process with pid returned by subprocess.Popen does not kill the actual bag recording. We also need to kill its child. There is a nice code snippet here for kill_child_processes(). Here is my modified version:

import subprocess, os, signal

def terminate_process_and_children(p):
    ps_command = subprocess.Popen("ps -o pid --ppid %d --noheaders" % p.pid, shell=True, stdout=subprocess.PIPE)
    ps_output = ps_command.stdout.read()
    retcode = ps_command.wait()
    assert retcode == 0, "ps command returned %d" % retcode
    for pid_str in ps_output.split("\n")[:-1]:
            os.kill(int(pid_str), signal.SIGINT)
    p.terminate()

This function expects a subprocess.Popen object.

2011-12-05 01:03:59 -0500 received badge  Nice Answer (source)
2011-12-04 07:03:28 -0500 received badge  Teacher (source)
2011-12-04 02:01:58 -0500 answered a question set tf_remap private parameters from console

I have recently come across the same problem. I continued your brute-force and found a working command:

rosrun tf tf_remap _mappings:='[{old: /neck_2, new: /neck_1}]' 
Applying the following mappings to incoming tf frame ids {'/neck_2': '/neck_1'}
2011-11-22 19:11:10 -0500 answered a question Service call failed while launching the gazebo

Yes, I am on Oneiric. So I tried to compile pr2-simulator from sources. Unfortunately,

pr2_simulator/pr2_gazebo_plugins/src/gazebo_ros_controller_manager.h

has several includes that could not be found.

#include "gazebo.h"
#include "physics/World.hh"
#include "physics/Model.hh"
#include "physics/physics.h"
#include "common/Time.hh"

I was able to locate the first three and the last header, and changing to

#include "gazebo/gazebo.h"
#include "gazebo/World.hh"
#include "gazebo/Model.hh"
#include "gazebo/Time.hh"

solved the issue. But I don't have physics.h in my filesystem at all. Any ideas to where it belongs?

2011-11-21 23:09:08 -0500 received badge  Editor (source)
2011-11-21 23:08:36 -0500 answered a question Service call failed while launching the gazebo

I get a similar error with libgazebo_ros_controller_manager.so, however that does not make my simulation to fail, i.e. the Gazebo window and a robot are displayed:

Error: [/tmp/buildd/ros-electric-simulator-gazebo-1.4.9/debian/ros-electric-simulator-gazebo/opt/ros/electric/stacks/simulator_gazebo/gazebo/build/gazebo/server/controllers/ControllerFactory.cc:101]
Failed to load libgazebo_ros_controller_manager.so: libgazebo_ros_controller_manager.so: cannot open shared object file: No such file or directory
[/tmp/buildd/ros-electric-simulator-gazebo-1.4.9/debian/ros-electric-simulator-gazebo/opt/ros/electric/stacks/simulator_gazebo/gazebo/build/gazebo/server/controllers/ControllerFactory.cc:71]
  Error Loading Controller of type [gazebo_ros_controller_manager], skipping

I tried to install pr2_simulator stack with apt-get, however it does not seem to exist (Ubuntu Oneiric):

$ sudo apt-get install ros-electric-pr2-simulator
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ros-electric-pr2-simulator
2011-11-20 08:12:58 -0500 commented answer Compiling tf or tf2 with -std=gnu++0x
Thanks for the suggestion. I opened a ticket at ros-pkg trac. Clearly, 'constexpr' is not an acceptable solution as it won't compile with C++03.