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

jwhendy's profile - activity

2021-05-21 16:38:00 -0500 commented answer undefined parameters [kinematics_file] in urdf.xacro

I was using this parameter and had been a long time since I updated my system. Everything was working, then it wasn't. I

2020-05-09 20:26:32 -0500 received badge  Famous Question (source)
2020-03-25 09:02:10 -0500 marked best answer Preferred method to discuss wiki changes?

On other wiki's I've contributed to, there is often a discussion method. I'm happy to help with changes, but being new to ROS I second guess whether or not these changes would be helpful or even accurate. Is this site appropriate, should I be doing this on the discussion forums, other?


As an example, I stumbled on this question about ROS_INFO_STREAM and actually don't think it's a horrible question in principle. I'm quite new, and was looking for a handy equivalence table between ROS_VERBOSITY_TYPE and equivalent rospy.logVerbosity() calls using python. In looking through the wiki on logging, I think it would help to provide the base format up front:

ROS_VERBOSITY_TYPE

As it is, a beginner has to figure out that DEBUG in all of the examples could be any of the other verbosity levels. Also, I noticed that the intro says:

roscpp uses the rosconsole package to provide its client-side API. That API takes the form of a number of ROS_ macros:

rosconsole provides four different types of logging statements, at 5 different verbosity levels, with both printf- and stream-style formatting.

I think the "types" are what are spelled out next, but this yields a list much longer than 4: base, named, conditional, conditional named, once, throttle, delayed throttle, filter.

I could make various changes to remedy this... but it helps to have confirmation that I'm not just experiencing noob confusion and the things that don't make sense are legitimate. Thanks for any suggestions.

2020-01-08 15:17:32 -0500 commented answer tf_echo can find transform but waitForTransform can't

@felipeduque just as above. They key is that instead of using the code here, use the code here. Because the static trans

2019-10-24 17:51:02 -0500 received badge  Famous Question (source)
2019-09-19 18:26:53 -0500 received badge  Famous Question (source)
2019-09-19 18:26:53 -0500 received badge  Notable Question (source)
2019-07-31 13:04:10 -0500 received badge  Notable Question (source)
2019-07-31 13:04:10 -0500 received badge  Popular Question (source)
2019-07-28 23:02:41 -0500 edited question Should ROS msg/srv files end in a newline?

Should ROS msg/srv files end in a newline? I was perplexed on a recent commit preview to see this symbol on github after

2019-07-28 23:02:22 -0500 asked a question Should ROS msg/srv files end in a newline?

Should ROS msg/srv files end in a newline? I was perplexed on a recent commit preview to see this symbol on github after

2019-04-05 19:36:46 -0500 received badge  Famous Question (source)
2019-02-10 15:01:26 -0500 commented answer Creating an array/list of existing message type without defining custom message type?

Thanks for the reasoning. This is indeed a narrow use case. For the purpose of storing metadata, the field name doesn't

2019-02-09 20:19:24 -0500 commented answer Creating an array/list of existing message type without defining custom message type?

It seems that answer is "Yes," so now I know. For this particular scenario it seemed "heavy" to do this when I really ju

2019-02-09 20:18:20 -0500 commented answer Creating an array/list of existing message type without defining custom message type?

@gvdhoom: the question was prompted by the fact that a foo msg corresponding to some Foo.msg can be used as a foo[]. Is

2019-02-09 00:56:36 -0500 received badge  Popular Question (source)
2019-02-04 16:17:33 -0500 edited question Creating an array/list of existing message type without defining custom message type?

Creating an array/list of existing message type without defining custom message type? Is there a way to create an array

2019-02-04 16:16:01 -0500 asked a question Creating an array/list of existing message type without defining custom message type?

Creating an array/list of existing message type without defining custom message type? Is there a way to create an array

2019-01-20 01:33:37 -0500 commented answer Cannot install ros-melodic-rostime on Archlinux

Agreed. I now think that since I downgraded cmake via arch archive binaries, it was likely compiled against previous ver

2019-01-19 17:56:55 -0500 commented answer if __name__ == '__ STATIC main__' in tf2 tutorials

I just closed that, and this is marked as an answer already.

2019-01-19 14:38:33 -0500 marked best answer if __name__ == '__ STATIC main__' in tf2 tutorials

The tf2 tutorial on static frames abruptly ends without explaining this:

if __name__ == '__ STATIC main__':
    rospy.init_node('my_tf2_broadcaster')

I've never seen __ STATIC main__ and from googling I can't tell if it's a ROS specific thing or general python syntax. I get no hits for it exactly, so I'm wondering if it's a typo. If so and it should be '__main__', I'm still confused as it would appear the second block would never run.

Could someone clarify that section of code?

2019-01-17 00:33:29 -0500 commented answer Cannot install ros-melodic-rostime on Archlinux

While maybe not a ROS bug, others are wrestling with this here too.

2019-01-17 00:30:37 -0500 commented answer Cannot install ros-melodic-rostime on Archlinux

Ran into this same issue. I also ended up needing to downgrade to boost and boost-libs 1.68.0-2 instead of the current 1

2018-12-25 17:43:55 -0500 received badge  Famous Question (source)
2018-12-25 17:43:55 -0500 received badge  Notable Question (source)
2018-10-17 20:23:42 -0500 received badge  Nice Question (source)
2018-10-15 11:41:45 -0500 commented answer Best way to add a topic to an existing rosbag?

So that's what I meant by misleading. The answer isn't wrong, it just dangled hope before me but when I looked at the li

2018-10-15 11:39:46 -0500 commented answer Best way to add a topic to an existing rosbag?

For the answer, it seems simpler to write the details of the method in addition to linking vs. just linking with ambiguo

2018-10-15 11:38:19 -0500 commented answer Best way to add a topic to an existing rosbag?

I interpreted the question to be about modifying a file. I haven't tried, and wouldn't recommend, but foo = bag(file.bag

2018-10-15 10:55:16 -0500 commented question Best way to add a topic to an existing rosbag?

Add to an bag you just created in w mode or add to a file by opening and appending? The latter is not possible

2018-10-15 10:53:30 -0500 commented answer Best way to add a topic to an existing rosbag?

In other words, the first sentence is misleading and I think should be "You can't do this in place. You have to create a

2018-10-15 10:53:21 -0500 commented answer Best way to add a topic to an existing rosbag?

In other words, the first sentence is misleading and I think should be "You can't do this in place. You have to create a

2018-10-15 10:51:55 -0500 commented answer Best way to add a topic to an existing rosbag?

Based on the rosbag API link (which only provides the 'w' option for writing, and this erases an existing bag) and the m

2018-10-11 16:21:26 -0500 marked best answer tf transform tutorial issue (past extrapolation)

I'm working through the python tf tutorial and am having an issue with an extrapolation into the past. Here's the section:

So let's go back to where we ended in the previous tutorial. Go to your package for the tutorial:

$ roscd learning_tf

Now, instead of making the second turtle go to where the first turtle is now, make the second turtle go to where the first turtle was 5 seconds ago. Edit nodes/turtle_tf_listener.py:

try:
    now = rospy.Time.now() - rospy.Duration(5.0)
    listener.waitForTransform("/turtle2", "/carrot1", now, rospy.Duration(1.0))
    (trans, rot) = listener.lookupTransform("/turtle2", "/carrot1", now)

except (tf.Exception, tf.LookupException, tf.ConnectivityException):

The referenced "previous tutorial" taught about waitForTransform() and fixed a future extrapolation like so:

listener.waitForTransform("/turtle2", "/carrot1", rospy.Time(), rospy.Duration(4.0))
while not rospy.is_shutdown():
    try:
        now = rospy.Time.now()
        listener.waitForTransform("/turtle2", "/carrot1", now, rospy.Duration(4.0))
        (trans,rot) = listener.lookupTransform("/turtle2", "/carrot1", now)

Based on that (which worked) and the changes shown above, here is my full code:

#!/usr/bin/env python

import rospy
import tf
import turtlesim.srv
import geometry_msgs.msg
import math

if __name__ == '__main__':
    rospy.init_node('tf_turtle')

    listener = tf.TransformListener()

    rospy.wait_for_service('spawn')
    spawner = rospy.ServiceProxy('spawn', turtlesim.srv.Spawn)
    spawner(4, 2, 0, 'turtle2')

    turtle_vel = rospy.Publisher('turtle2/cmd_vel',
                                 geometry_msgs.msg.Twist,
                                 queue_size=1)

    rate = rospy.Rate(10)

    listener.waitForTransform('/turtle2', '/carrot1',
                              rospy.Time().now(),
                              rospy.Duration(4.0))

    while not rospy.is_shutdown():
        try:
            now = rospy.Time.now() - rospy.Duration(5.0)
            listener.waitForTransform('/turtle2', '/carrot1', now, rospy.Duration(1.0))
            (trans, rot) = listener.lookupTransform('/turtle2',
                                                    '/carrot1',
                                                    now)
        except(tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException):
            continue

        angular = 4 * math.atan2(trans[1], trans[0])
        linear = 0.5 * math.sqrt(trans[0] ** 2 + trans[1] ** 2)
        cmd = geometry_msgs.msg.Twist()
        cmd.linear.x = linear
        cmd.angular.z = angular
        turtle_vel.publish(cmd)

        rate.sleep()

I'm getting these types of errors about past extrapolation when I run the above:

listener.waitForTransform('/turtle2', '/carrot1', now, rospy.Duration(1.0))
tf.Exception: Lookup would require extrapolation into the past.  Requested time 1498858934.730669022 but the earliest data is at time 1498858934.911530972, when looking up transform from frame [carrot1] to frame [turtle2]. canTransform returned after 1.00266 timeout was 1.

I've tried inserting a rospy.sleep(5) above the while section to ensure that there's 5 seconds of data, as well as having the first call to waitForTransform use rospy.Time.now() - rospy.Duration(5.0) to match the second argument. I'm not really sure what's going on. The tutorial goes on to suggest this is not really what you want anyway, but it still shows it like it should run so I'm confused at my results!


EDIT: I've left the original question as-is, but wanted to respond to the comments by making this more reproducible. I started over from the beginning, creating versions of each file as I went. These are now on github. If you want ... (more)

2018-08-08 01:36:03 -0500 marked best answer rospy equivalent to ros::NodeHandle nh("namespace")

I'm very new to ROS and am [slightly] more versed in python than C++, so that's the route I'm currently pursuing in my learning. One option that is shown in the C++ tutorials is how one would set a custom namespace or parent namespace :

You can also specify a parent NodeHandle and a namespace to append:

### adding the initialization call from above
ros::init(argc, argv, "my_node_name");

ros::NodeHandle nh1("ns1");
ros::NodeHandle nh2(nh1, "ns2");

In the python information, I've only ever seen this used, which I take as equivalent to ros::init():

rospy.init_node('my_node_name')

How would one put node my_node_name into a custom or parent namespace using rospy?

2018-07-26 12:23:11 -0500 received badge  Notable Question (source)
2018-07-26 12:23:11 -0500 received badge  Popular Question (source)
2018-07-20 12:17:32 -0500 received badge  Notable Question (source)
2018-07-20 12:17:32 -0500 received badge  Popular Question (source)
2018-07-02 16:26:20 -0500 edited answer rospy subscribing to topic, how can i save a variable?

Super late, and this is more of a general python question, but you can avoid global variables by just passing things aro

2018-07-02 16:25:47 -0500 answered a question rospy subscribing to topic, how can i save a variable?

Super late, and this is more of a general python question, but you can avoid global variables by just passing things aro

2018-03-18 13:14:59 -0500 commented answer Understanding relationship between new xacro macros and --inorder

Thank you for clarifying and the PR was immensely helpful to understanding what was going on. I now see that this is jus

2018-03-18 12:59:23 -0500 received badge  Popular Question (source)
2018-03-18 12:18:16 -0500 marked best answer Understanding relationship between new xacro macros and --inorder

I just learned of the new Jade xacro macros as part of a PR I submitted. In switching to using ${radians(foo)}, the build failed. In comparing to other robots in the kuka_experimental repository, I found a few differences, one of which being the --inorder flag. I was informed that these new Jade macros require --inorder, but I didn't see that on the wiki.

I've updated the wiki on math expressions to suggest using --inorder, but I'm still a bit confused by the behavior and thought I'd bring it here in case there were further doc changes that might be helpful.

For one, I updated two robot macros.xacro files to use ${radians()} for their joint limits. One failed (linked above), and one succeeded. Changing the first to use --inorder fixed the build error. The second still doesn't have it, yet this somehow passes the build?

<launch>
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find kuka_lbr_iiwa_support)/urdf/lbr_iiwa_14_r820.xacro'" />
</launch>

Secondly, the wiki suggests that one can test whether or not this flag affects their xacro files with:

rosrun xacro xacro file.xacro > /tmp/old.xml
rosrun xacro xacro --inorder file.xacro > /tmp/new.xml
diff /tmp/old.xml /tmp/new.xml

I assumed that if --inorder was the source of issues, I'd detect it with this test? In trying that on lbr_iiwa_14_r820_macro.xacro and lbr_iiwa_14_r820.xacro in this branch of kuka_experimental, I get no results for either using diff (identical output).

Could someone with more macros experience help illuminate what's going on here and suggest any changes I could make to the wiki to help others? I found this to be pretty nuanced/subtle, and it caused maybe an hour of trying random things, waiting for a Travis build, and repeating. It'd be nice to help other users avoid this.

2018-03-17 12:23:56 -0500 asked a question Understanding relationship between new xacro macros and --inorder

Understanding relationship between new xacro macros and --inorder I just learned of the new Jade xacro macros as part of

2018-03-01 17:23:18 -0500 received badge  Notable Question (source)