Ask Your Question

courrier's profile - activity

2019-02-22 06:24:22 -0500 received badge  Nice Answer (source)
2018-08-08 01:01:32 -0500 marked best answer [rosparam] do not overwrite an existing param or default value

Hi all,

I'm looking for a way to specify a DEFAULT value for /some/parameter on the parameter server in a XML launch file. In other terms if it's already there I don't want to overwrite the previous value.

Also is it possible to test any other variable than a bool? I would like to do something like:

  <!-- THIS DOES NOT WORK -->
  <node if="$(arg method)==nearest" name="point_provider" pkg="point_providers" type="simple_publisher.py" />
  <node if="$(arg method)==regression" name="point_provider" pkg="regression_models" type="publisher.py" />

Is there any way to achieve this?

Also a complete control structure if/elif/else would be nice.

Thanks

2018-01-29 04:45:19 -0500 received badge  Good Answer (source)
2017-11-17 07:22:42 -0500 received badge  Great Answer (source)
2017-11-17 07:22:42 -0500 received badge  Guru (source)
2017-08-11 09:57:08 -0500 received badge  Taxonomist
2017-07-20 12:04:38 -0500 received badge  Famous Question (source)
2017-07-01 16:13:36 -0500 received badge  Famous Question (source)
2017-05-26 08:32:13 -0500 received badge  Nice Question (source)
2017-05-26 08:32:08 -0500 received badge  Self-Learner (source)
2017-04-20 16:47:54 -0500 marked best answer [rviz] tf and Interactivemarker: pose with respect to which frame?

Hi all,

I wonder in which frame the interactive_marker.pose field is expressed? It seems relative to interactive_marker.header.frame_id but even considering that hypothesis, I get a strange behaviour. Let me explain...

I'm writing an application were several parts of furniture (leg, back of a chair...) are represented in RViz has interactive markers.

Each part is relative either to the world or to another part and all of them publish their transform with a TransformBroadcaster. view_frames gives: view_frames result

It seems that InteractiveMarker.pose designates the coordinates of the IM with respect to the frame InteractiveMarker.header.frame_id so when I set a new frame_id for an existing object I recompute the InteractiveMarker.pose with respect to the new frame_id, so that the pose doesn't move in the world frame. This works well, the new coordinates are computed with respect to the new frame thanks to a tfListener and there are correct.

When I move the parent frame with RViz, the child frame also moves because the pose of the child doesn't change with respect to the parent and this is exactly want I want.

Except that, when I click on the child object it's suddenly teleported elsewhere. I have disabled all callbacks for the Interactive Marker, so the server does that on its own But I don't know why. The transformation applied to the object is not random, it is exactly the transformation from its parent to the world.

Here is as exemple, I start with the interactive marker "leg1" at x=0 y=0 z=5 with respect to /world. I set it relative to /sitting which is at 0 0 -1 with respect to /world. The coordinates of "leg1" with respect to the world are computed by a tfListener and are 0 0 6, so I give these coordinates to leg1.pose.position = (0, 0, 6). Then when I click on "leg1" without moving it, it's teleported to 0 0 5 relative to /sitting, and if I click again 0 0 4, 0 0 3, and so on.

[ INFO] [1394553885.833971573]: leg1 is at 0 0 5 relative to /world
[ INFO] [1394553885.834646868]: [callback] leg1 set relative to sitting which is at 0 0 -1 relative to /world
[ INFO] [1394553885.848262357]: leg1 0 0 6 relative to /sitting
[ INFO] [1394553885.845737564]: [callback] leg1 is clicked (but not moved and no code is executed)
[ INFO] [1394553886.719846935]: leg1 0.10338 0.06199 6.96599 relative to /sitting (so almost 0 0 7)

It sounds like I forgot to set a "frame_id" somewhere to avoid the server to apply this automatic pose transformation. But I don't know where because if I server->get("leg1") the frame_id is actually set to "sitting".

I have been tearing my hear out on this issue for one week, but it's still unsolved and I don't know what to do with that :( I hope my explanations are understandable.

All clues are welcome, many thanks by advance ... (more)

2016-06-17 12:46:07 -0500 marked best answer TF listening fails when called from a specific class

Hi all,

I initially had one C++ class broadcasting and listening to tf:Transforms successfuly. The structure of my class was something like:

class TF_Listening_OK {
    private:
        tf::TransformBroadcaster _transf_bdcst;
        tf::TransformListener _transf_lsten;

    public:
    void spin() {
        Rate r(25);

        while(ros::ok()) {
                tf::Transform transform = blablabla...;
            _transf_bdcst.sendTransform(tf::StampedTransform(transform,
                                             Time::now(),
                                             "world",
                                             "myframe"));
            ros::spinOnce();
        }
    }

    void someCallback() {
        try {
            PoseStamped pstdin, pstdout;
            pstdin.header.frame_id = "world";
            pstdin.pose = some_pose_in_world;
            _transf_lsten.transformPose("myframe", pstdin, pstdout);
        }
        catch() we don't care...
    }

The code hereabove works great! My issue comes in the next step.

Then I've created a TF_Listening_Failure class which does not broadcast any frame but which listen to some tf broadcasted by TF_Listening_OK. It's code is in the same node and same thread and is executed when a callback is received. Something like:

class TF_Listening_Failure {
    private:
        tf::TransformListener _transf_lsten;

    public:
    void someCallback() {
        try {
            PoseStamped pstdin, pstdout;
            pstdin.header.frame_id = "myframe";
            pstdin.pose = some_pose_in_myframe;
            _transf_lsten.transformPose("world", pstdin, pstdout);
        }
        catch() we don't care...
    }

But it fails with code:

terminate called after throwing an instance of 'tf::LookupException'
  what():  Frame id /myframe does not exist! Frames (1): 
Aborted (core dumped)

I am 400% sure that "myframe" is actually broadcasted with respect to "world". I can draw the tf tree seeing myframe published as a child of world at 25Hz. Not only the world frame does exist (I've also replaced world by other frames in the transformPose but it always fails) but also it's not even able to list available frames (= this aborted error, I figured out with gdb that it occured during spinOnce()).

The awful solution I've found for the moment is creating a PoseStamped TF_Listening_OK::performTFListening(PoseStamped pstdin). Calling this method from TF_Listening_Failure works well but this is SO UGLY.

I'm not sure whether the portion of code I've posted is useful, but I'm so lost with this issue that I don't know what is relevant. Any idea of what could be wrong? Can we have only one declared tf listener of something like this? Thank you by advance for your help.

2016-06-06 13:12:26 -0500 received badge  Good Question (source)
2016-05-07 14:59:08 -0500 received badge  Famous Question (source)
2016-04-07 20:37:34 -0500 marked best answer RViz and interactive markers: Why does not pose automatically updated?

Hi all,

When an interactive marker's pose is changed using a control (for instance the 6-DoF control provided in basic_controls), why does the field int_marker.pose is not filled why the new value automatically?

I spent a long time debugging my node when I realized that I had to update it myself with such a callback function for instance:

void processFeedback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &amp;feedback)
{
switch (feedback-&gt;event_type) {
    case visualization_msgs::InteractiveMarkerFeedback::POSE_UPDATE:
        int_marker.pose = feedback-&gt;pose; // MANDATORY??
        server-&gt;insert(int_marker, &amp;processFeedback);
        server-&gt;applyChanges();
        break;
}

Even if the pose is not updated, the display is correct and my object moves when I control it with the interactive marker, so where are stored its coordinates?

Many thanks

2016-04-07 09:10:34 -0500 received badge  Good Answer (source)
2016-04-07 09:10:34 -0500 received badge  Enlightened (source)
2016-03-05 11:32:09 -0500 received badge  Nice Question (source)
2016-01-25 08:44:00 -0500 received badge  Nice Answer (source)
2016-01-06 09:48:02 -0500 received badge  Notable Question (source)
2015-11-24 14:10:32 -0500 received badge  Famous Question (source)
2015-11-24 14:10:32 -0500 received badge  Popular Question (source)
2015-11-24 14:10:32 -0500 received badge  Notable Question (source)
2015-11-04 20:27:32 -0500 received badge  Popular Question (source)
2015-10-21 08:57:30 -0500 received badge  Nice Answer (source)
2015-09-07 00:27:24 -0500 marked best answer read yaml parameter in C++

Hi all,

I'm experiencing an issue in using the parameter server:

1) I start a roscore so that I get only one master on this machine. 2) I set a global param manually, say:

rosparam set /test/m '{"id0": 0, "id1": 1}'

3) I start one of my launchfile whose short version is:

<launch>
    <node pkg="mypckg" name="mynode" type="mynode" output="screen"/>
</launch>

I get:

roslaunch mypckg mylaunch.launch
... logging to /home/flowers/.ros/log/08d803da-74d2-11e4-9a51-a01d480daef0/roslaunch-zbook-4127.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://zbook:55760/

SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion

4) In the code of "mynode" I read this param:

                string m;
                if(!nh.getParam("/test/map", m))
                    ROS_ERROR("Failed to read 'map' on param server");

5) The above error is triggered, while rosparam get /thr/before still returns an existing value. It looks like I'm not reading params in the same namespace but I'm reading global parameters so I don't understand...

What are the PARAMETERS listed in the SUMMARY? Only parameters defined in the launch file or all available parameters on the server?

What am I missing? Thanks

2015-07-22 12:53:55 -0500 received badge  Nice Answer (source)
2015-07-15 03:14:05 -0500 received badge  Nice Question (source)
2015-05-15 05:00:20 -0500 received badge  Notable Question (source)
2015-03-27 06:13:55 -0500 received badge  Famous Question (source)
2015-03-03 13:55:05 -0500 received badge  Necromancer (source)
2015-02-25 20:52:55 -0500 received badge  Notable Question (source)
2015-02-20 18:57:59 -0500 received badge  Popular Question (source)
2015-02-11 09:21:10 -0500 commented answer roslib.packages is deprecated, what's its successor?

Thanks for the snippet, it works! Hope there will be an equivalent, this method is really handy.

2015-02-11 00:28:55 -0500 received badge  Popular Question (source)
2015-02-10 04:14:15 -0500 asked a question roslib.packages is deprecated, what's its successor?

Hi all,

The documentation says roslib.packages is deprecated and lets know that rospkg is the new stable API. However I can't find the equivalent methods in rospkg, what are the new get_pkg_dir(), find_resource() ...?

Thanks

2015-01-20 11:23:29 -0500 received badge  Famous Question (source)
2014-12-18 16:49:01 -0500 received badge  Famous Question (source)
2014-12-09 09:33:01 -0500 received badge  Famous Question (source)
2014-12-08 05:11:32 -0500 received badge  Notable Question (source)
2014-12-07 03:13:18 -0500 received badge  Notable Question (source)