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

curranw's profile - activity

2022-02-15 11:22:33 -0500 received badge  Good Question (source)
2020-12-20 23:35:28 -0500 marked best answer rqt_bag and rosbag not publishing same messages

Hello,

I'd like to visualize a robot performing a specific task. This involves playing a bag file with rqt_bag and visualizing the tf frames in RViz. I load the bag in rqt_bag, publish tf, and set "Play all Messages".

The first problem: Playing the bag file in rqt_bag when setting "Play all Messages" is really slow. Much slower than playing the bag with rosbag play. This isn't a huge issue.

The bigger issue: When visualizing the robot description in RViz the robot is "teleporting" around the space. I looked into this, and found that not all of the tf messages are being published, in spite of setting "Play all Messages". When using rosbag play, this problem doesn't occur.

To test this, I subscribed to tf when playing the bag in rqt_bag and rosbag play. I output the messages to two separate files and compare them in Beyond Compare (amazing program FYI). Many messages played in rosbag play don't show up in rqt_bag.

Is there a current workaround for this? My suspicion is that rqt_bag not publishing all of the tf messages, but could there be a different source of the issue?

2020-12-20 23:35:28 -0500 received badge  Self-Learner (source)
2020-12-20 23:33:56 -0500 marked best answer Including both Python and C++ Plugins in a single RQT Plugin

I'm writing a RQT plugin that includes some functionality of other plugins, as well as my own.

My plugin is in C++, because I'd like to add some rqt_rviz visualization. Mainly the OGRE window.

Along side the RViz visualization, I want to add some functionality of the rqt_bag plugin. I plan on branching this plugin and heavily modifying it.

I want to combine the two plugins in code and create my plugin. I'll call that rqt_curranw. The final product (assume rqt_bag will be much different) looks like the screenshot attached.

The issue is...rqt_bag is written in Python and rqt_rviz is written in C++. I can create two plugins and dock them next to each other, but I'd rather have my single plugin include all of the functionality I want. No extra steps. I can kind of get around this by using a perspective, but I don't see a way to include arguments to the plugins using perspectives.

So my question is, how can I include functionality from both plugins in my one plugin widget? In C++, I can use the pluginlib::ClassLoader to upload the rqt_rviz plugin, and use the functions associated with that class. However, I can't use it to load the rqt_bag plugin, since it's written in Python.

I've looked through rqt_gui for inspiration and it's a monster. I'm hoping to find some quick answers here before jumping down that rabbit hole.

Thoughts:

  • Is there a way to latch onto an existing QtApplication. For example, if the QtApplication is written in C++ can a simultaneous Python process access it and add widgets to it? Or vice-versa?

  • I assume there is a way to do this, since rqt_gui uploads both Python and C++ plugins, and is written in Python.

  • Is there a way to hack perspectives to use plugin arguments? Is this the right approach?

  • Am I barking up the wrong tree and over-complicating things?

image description

2019-05-24 08:20:01 -0500 marked best answer Service buffer overrun only when service is persistent

I'm using a rospy service call to a custom c++ gazebo library. Ever time this service is called, gazebo takes a certain number of simulation steps, and responds with the new sensor measurements. I'm running many trials, so I'd like to run this as quickly as possible, so I started using persistent connections.

rospy.wait_for_service('step_service')
self.step_service = rospy.ServiceProxy('step_service', ActionService, True)
action = np.zeros((12,1))
self.state = self.step_service(action)

and my cpp service server is:

step_service = rosnode->advertiseService("/step_service", &GazeboRosStepper::step_srv, this);

bool GazeboRosStepper::step_srv(gazebo_ros_stepper::ActionService::Request  &req, gazebo_ros_stepper::ActionService::Response &res)
{
    step
    fill response with joint angles, velocities (24 doubles)
    return true
}

When the step_service in the python code is persistent, I get the errors:

rospy.service.ServiceException: service [/step_service] responded with an error: b'Buffer Overrun'

This is no matter the size of my response (I commented out most of the response, still errors) or the size of my request. It also happens during the first call.

Everything works perfectly when things are not persistent. However, since I'm calling this as fast as possible, I'd like to remove the wasted computation for resetting the TCP connection every time.

2019-05-23 11:48:45 -0500 commented answer Service buffer overrun only when service is persistent

Did you test this? If so, I'll accept it as an answer. I just turned off persistent, which is not ideal but worked.

2019-02-15 01:14:59 -0500 received badge  Notable Question (source)
2019-02-15 01:14:59 -0500 received badge  Famous Question (source)
2019-01-04 18:20:18 -0500 received badge  Famous Question (source)
2018-08-28 11:50:43 -0500 received badge  Famous Question (source)
2018-02-27 06:45:40 -0500 received badge  Notable Question (source)
2018-02-22 14:31:20 -0500 received badge  Famous Question (source)
2018-02-22 14:31:20 -0500 received badge  Notable Question (source)
2018-01-10 02:13:21 -0500 received badge  Popular Question (source)
2018-01-09 10:24:29 -0500 edited question Service buffer overrun only when service is persistent

Service buffer overrun only when service is persistent I'm using a rospy service call to a custom c++ gazebo library. Ev

2018-01-09 10:16:56 -0500 commented question Service buffer overrun only when service is persistent

I do not call spin! This makes sense now. I'm surprised it worked without the persistent call. Also: Doesn't a service

2018-01-09 10:12:54 -0500 commented question Service buffer overrun only when service is persistent

I do not call spin! This makes sense now. I'm surprised it worked without the persistent call now. Also: Doesn't a serv

2018-01-09 10:12:25 -0500 commented question Service buffer overrun only when service is persistent

I do not call spin! This makes sense now. I'm surprised it worked without the persistent call now. Also: Doesn't a serv

2018-01-09 10:11:04 -0500 commented question Service buffer overrun only when service is persistent

I do not call spin! Great point. This makes sense now. I'm surprised it worked without the persistent call now. Since r

2018-01-09 09:18:44 -0500 edited question Service buffer overrun only when service is persistent

Service buffer overrun only when service is persistent I'm using a rospy service call to a custom c++ gazebo library. Ev

2018-01-09 09:18:44 -0500 received badge  Associate Editor (source)
2018-01-09 09:13:28 -0500 asked a question Service buffer overrun only when service is persistent

Service buffer overrun only when service is persistent I'm using a rospy service call to a custom c++ gazebo library. Ev

2017-12-21 08:19:19 -0500 received badge  Famous Question (source)
2017-07-10 08:48:23 -0500 received badge  Notable Question (source)
2017-05-15 06:54:00 -0500 received badge  Famous Question (source)
2017-05-11 08:01:02 -0500 received badge  Notable Question (source)
2017-05-04 17:30:37 -0500 received badge  Famous Question (source)
2017-01-23 08:23:08 -0500 received badge  Famous Question (source)
2016-12-24 07:56:55 -0500 received badge  Popular Question (source)
2016-12-14 13:54:46 -0500 marked best answer How to find a node type during runtime

I'd like to be able to find a node type (not user-defined name) of a currently running node. Basically, what file was actually being executed.

"Nodes also have a node type, that simplifies the process of referring to a node executable on the fileystem." -Wiki

This is relatively easy if the node is launched from a roslaunch command, I can simply look at the logging. From a rosrun command, I can't seem to find equivalent logging. Watching the loggers are a bit of a hack, and I'm sure there is a proper API to do this, but I can't seem to find it. Rosnode gets close.

The ideal solution is to use a getter to access elements of the Node class, a part of the roslaunch.core package. If this is not possible, is there a work-around?

2016-12-14 13:54:43 -0500 received badge  Nice Question (source)
2016-12-10 19:04:18 -0500 received badge  Notable Question (source)
2016-11-30 09:53:14 -0500 received badge  Notable Question (source)
2016-11-23 12:33:59 -0500 received badge  Notable Question (source)
2016-11-23 12:33:59 -0500 received badge  Popular Question (source)
2016-11-06 09:40:18 -0500 received badge  Famous Question (source)
2016-11-02 16:03:06 -0500 received badge  Popular Question (source)
2016-11-01 19:28:33 -0500 asked a question Proper ROS way to call python from C++

I have a large python library that interfaces with sklearn, and a large C++ library that interfaces with the robot, runs ROS, and has a lot of other robot-esque functionality. I'd like to use my python library in my C++ library. Rather than mess with the Python.h, I figured ROS would be a much cleaner interface.

I used services to connect to my python library, but they are simply too slow. This makes me think service calls may be the wrong way to do this. I set the persistent flag to true. That helped, but still isn't quite fast enough.

I'm in the process of switching to messages, but it's a major hack, since I'm essentially calling a ros::spinOnce after every publication to force the "hand shaking" and playing too much with callbacks. Gross.

What are the ways to make service calls faster? Is the persistent flag it? Should I just be using the Python.h infrastructure?

2016-09-26 18:10:27 -0500 received badge  Popular Question (source)
2016-09-26 16:33:34 -0500 answered a question Properly restarting the gazebo simulation for iterative learning

Installing the newest version of gazebo fixed this issue. Gazebo 7 works great.

http://gazebosim.org/tutorials?tut=in...

http://gazebosim.org/tutorials?tut=in...

http://gazebosim.org/tutorials?tut=ro...

2016-09-22 15:07:01 -0500 commented question localization is not working properly when robot is rotating
2016-09-21 15:47:32 -0500 edited question Properly restarting the gazebo simulation for iterative learning

I've seen this question posted many times, but with no definitive answer (and they are old). To name a few:

1 2 3

However, many of these solutions don't really answer the question. reset_world seems to break all of the controllers. Just calling it with the pr2 model leads to a flow of red errors.

What I'm using now is the SetModelConfiguration service call. This works well...at the beginning. However, after the 10th or so experiment, the robot arm beings to "fling around" after the service call. After 20 or so experiments, the whole robot starts rocking as it gets called. It's as if the model is colliding with itself. I'm wondering why this is.

Thoughts: Could it be the effort controller? To test this I set all of the efforts to 0 between experimental runs, and give the controllers a second or two to settle before calling SetModelConfiguration. This didn't help.

Is gazebo storing some sort force? It seems like the controller would remove that. I use the "/gazebo/clear_body_wrenches" and the "/gazebo/clear_joint_forces" service calls to reset all forces, but that doesn't help either.

I'm out of ideas!

Here is a video showing when I use "SetModelConfiguration" 10 times with the same joint angles. Eventually it settles. I am giving no motor commands at this point, it's simply where the arm "settles" after resetting the joints.

2016-09-21 12:21:09 -0500 received badge  Organizer (source)