Ask Your Question
1

rostest on pr2

asked 2014-07-11 14:22:08 -0500

mbforbes gravatar image

updated 2014-11-22 17:05:47 -0500

ngrennan gravatar image

Is it possible to use rostest on the PR2?

I'm running them fine in simulation with pr2_gazebo. When I run on the real PR2 (of course without pr2_gazebo) I see:

[FATAL] [1405106407.155258687]: Could not load the xml from parameter server: robot_description
[ERROR] [1405106407.155347537]: Could not load robot model. Are you sure the robot model is on the parameter server?

My guess is it has something to do with the ROS IP address changing that rostest does, but I'm not sure. Many thanks for any help.

Basic info:
- Ubuntu 12.04
- ROS Groovy
- rosbuild
- python

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-07-11 17:37:26 -0500

ahendrix gravatar image

rostest is specifically designed not to interfere with a running ROS system, and to be stateless. To achieve this, it runs its own roscore on a different port. There is currently no way to turn off this feature.

What this means is that your test files must do everything to set up the parameters, environment and any simulation or robot that your test needs in order to run.

I suspect that your original test had an include for the PR2 launch file, and you simply removed that when trying to run it on a real robot. This approach fails, because your nodes will now be running on a separate roscore, without a robot to talk to at all.

Instead, I recommend setting up three launch/rostest files:

  1. A core test which includes the nodes you're testing, and your test nodes
  2. A simulation rostest file which sets up the simulation by including the appropriate PR2 gazebo launch files, and then includes your core test file (#1)
  3. An optional PR2 rostest file which includes the PR2 launch file (the one normally run by robot start), and your core test file (#1)

Your simulation test is then simply invoking rostest #2

If you want to run your tests on a real robot, you have a few choices:

  • Start the robot normally, and use roslaunch to run your core test file (#1). This will run all of the regular nodes in that file, but not the test nodes
  • Stop the robot, and use rostest to run your PR2 rostest file (#3). This file will then start all of the PR2 processes, and along with your nodes and tests, run them, and produce a test result.
edit flag offensive delete link more

Comments

Thanks for the thorough answer! I think #3 was the key insight that helped me.

mbforbes gravatar imagembforbes ( 2014-08-10 18:36:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-07-11 14:22:08 -0500

Seen: 140 times

Last updated: Jul 11 '14