Ask Your Question

sd1074's profile - activity

2017-04-05 08:56:34 -0600 received badge  Famous Question (source)
2016-10-30 20:08:48 -0600 received badge  Notable Question (source)
2016-10-30 01:43:16 -0600 received badge  Popular Question (source)
2016-10-29 19:44:22 -0600 commented question Issues with header seq value (first value in rospy is 1, first value in roscpp is 0, access from roscpp)

I submitted this issue to ros_comm tracker: https://github.com/ros/ros_comm/issue...

2016-10-28 19:18:24 -0600 answered a question Exit code of roslaunch shutdown on node death

I faced the same issue and I believe it is an important feature missing in roslaunch. I submitted a feature request/but report here: https://github.com/ros/ros_comm/issue...

2016-10-24 05:28:07 -0600 received badge  Enthusiast
2016-10-21 17:42:46 -0600 received badge  Organizer (source)
2016-10-21 17:32:10 -0600 received badge  Editor (source)
2016-10-21 17:31:27 -0600 asked a question Issues with header seq value (first value in rospy is 1, first value in roscpp is 0, access from roscpp)

I was planning to use Header seq value to verify that communication in my system of ROS-nodes (using ROS Indigo) is synchronized, however, I discovered a couple issues with that value. If that's a bug, I guess I can submit it to the ROS issue tracker.

  1. The value of seq in the first message published with a rospy node is 1, whereas the value of seq in the same case with roscpp node is 0 (see examples below). That looks somewhat inconsistent. Is that an expected behavior or a bug?
  2. In rospy, msg.header.seq is updated every time the message is published. In roscpp, in the published data the value is incremented as well, but the value in the message object itself doesn't seem to be updated (always 0). How to actually read that value?

Python example

First, let's take a look at a slightly modified talker example from the tutorials:

#!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped

def talker():
    pub = rospy.Publisher('chatter', PoseStamped, queue_size=1000)
    rospy.init_node('talker', anonymous=True)
    rospy.sleep(10) # just to ensure we don't miss any messages with rostopic echo
    rate = rospy.Rate(1)
    msg = PoseStamped()
    while not rospy.is_shutdown():
        pub.publish(msg)
        rospy.loginfo("seq=%d" % msg.header.seq)
        rate.sleep()

if __name__ == '__main__':
    try:
        talker()
    except rospy.ROSInterruptException:
        pass

The output of the node is:

$ rosrun my_pkg chatter.py
[INFO] [WallTime: 1477087924.109463] seq=1
[INFO] [WallTime: 1477087925.110565] seq=2
[INFO] [WallTime: 1477087926.110574] seq=3

And the output of rostopic echo /chatter/header/seq is:

$ rostopic echo /chatter/header/seq
1
---
2
---
3
---

C++ example

Now a seemingly equivalent c++ node:

#include "ros/ros.h"
#include "geometry_msgs/PoseStamped.h"

int main(int argc, char **argv) {
    ros::init(argc, argv, "talker");
    ros::NodeHandle n;
    ros::Publisher chatter_pub = n.advertise<geometry_msgs::PoseStamped>("chatter", 1000);
    ros::Rate loop_rate(1);
    ros::Duration(5).sleep();
    geometry_msgs::PoseStamped msg;
    while (ros::ok())  {
        chatter_pub.publish(msg);
        ros::spinOnce();
        ROS_INFO("seq=%d", msg.header.seq);
        loop_rate.sleep();
    }
    return 0;
}

The output of the node is:

$ rosrun my_pkg chatter
[ INFO] [1477088294.353026135]: seq=0
[ INFO] [1477088294.353167359]: seq=0
[ INFO] [1477088295.353267882]: seq=0

And the output of rostopic echo /chatter/header/seq is:

$ rostopic echo /chatter/header/seq
0
---
1
---
2
---
2015-03-12 04:24:00 -0600 received badge  Famous Question (source)
2014-05-14 09:26:56 -0600 received badge  Notable Question (source)
2014-03-07 10:09:12 -0600 received badge  Popular Question (source)
2014-03-06 05:20:32 -0600 asked a question Static objects in Lidar view: set minimum distance or remove a sub-range of measurements

I have a Lidar which I can only mount on my robot in such a way that there is always a static obstacle (part of the robot) in the middle of the Lidar range. I am planning to use the Lidar for obstacle avoidance, thus I'd like to somehow remove the static obstacle from the Lidar view.

For my purposes it would be enough to filter out the measurements which are smaller than a certain min distance, or it would be even better if I could remove a certain angular range from the LaserScan. For example, my full Lidar range is from -135 degrees to +135 degrees, but I know that the measurements between, let's say, -10 degrees and +5 degrees will always return the same values (which will be interpreted by the obstacle avoidance algorithm as a very close object, and thus will affect the navigation), so I'd prefer to remove them from the LaserScan.

I am using: Hokuyo URG-04LX-UG01, urg_node driver, costmap_2d.

I could not find any standard mechanism for this in urg_node or costmap_2d, or another package. Please, let me know if such functionality is implemented anywhere, otherwise I'll have to write it myself. I'll appreciate any advice. Thanks.

2013-07-31 16:01:40 -0600 received badge  Teacher (source)
2013-07-31 16:01:40 -0600 received badge  Necromancer (source)
2013-06-28 05:04:26 -0600 answered a question Error with rosinstall: rosws cannot find lib

I am not sure what exactly went wrong in my case, but I had the same issue, and KruseT's advice didn't really work for me.

To resolve the problem (maybe not the cleanest solution), I created a couple of symlinks:

sudo ln -s /usr/share/pyshared/rosinstall /usr/lib/python2.7/dist-packages/rosinstall
sudo ln -s /usr/share/pyshared/vcstools /usr/lib/python2.7/dist-packages/vcstools

This worked for me.

2012-05-08 04:05:06 -0600 received badge  Supporter (source)
2012-04-03 10:28:55 -0600 commented answer what IMUs work with ROS?

Thanks for your reply, Eric. Do you know if there is anything analogous which would allow me to quickly use this IMU in ROS?

2012-04-02 13:56:09 -0600 answered a question what IMUs work with ROS?

Does anyone know what happened to the http://www.ros.org/wiki/imu_9drazor page? It seems to empty.