Using DRC vehicle commands in version 2.5
I built a self driving vehicle using version 2.2 by following the tutorial here:
http://gazebosim.org/wiki/Tutorials/d...PluginDRC_Vehicle
But after upgrading to 2.5, my code won't run anymore. I don't want to downgrade again since some of my other programs run on 2.5, so I'd rather just modify my existing vehicle driver to work for 2.5. What can I use to manipulate the drc vehicle in version 2.5?
Can you elaborate on what's not working? Are you trying to use ros topics? Are you able to echo the state topics like
rostopic echo /drc_vehicle/brake_pedal/state
? Are there any console error messages?According to my code, the driver should do this once the loop begins, get in the car, undo the handbrake, drive in figure 8, then four corner turns in a square, brake,reverse direction, brake, and repeat until forced termination. All it seems to do is enter the car, I get the printed messages on the console, so I know it's executing the functions with no error. I think according to the code I am using rostopics. I'm not sure about the echoing, I haven't tried that. What's the result wanted?
Just to reiterate, I have posted a copy of my code on pastebin for others to analyze, are there any more suggestions?
Ok, I've examined your code. It looks like you are using ros topics for control. I'm trying to remember if there were bugs with vehicle control in drcsim_2.5. The latest version is 2.6, but there's a few things to try aside from upgrading.
Can you try running the command from the command line while the simulation is running: "
rostopic echo /drc_vehicle/brake_pedal/state
" It should print out several numbers near zero if the brake pedal is not pressed. If there's no messages, then there's a problem with the vehicle plugin.I've actually upgraded as I've made some progress on a different machine with 2.6, I have a new problem now that is right here:http://answers.gazebosim.org/question/3395/sdf-version-problems-cause-drcsim26-and-gazebo18/.this topic is still open though.
Updated issue has been resolved, and the VRC cheats seem to work, as the wheels can now turn, however the vehicle still will not move, so either the issue is with the brake, handbrake, or accelerator. I adjusted values for all three, but no response.
When you say the wheels can turn, I assume you mean that the steering works? The following commands can help with debugging the brake, handbrake, and gas pedal:
rostopic echo /drc_vehicle/gas_pedal/state
,rostopic echo /drc_vehicle/brake_pedal/state
,rostopic echo /drc_vehicle/hand_brake/state
I've never used echo before, do I use that command before, during, or after running the executable? And do I do it in a new terminal next the one running the program or in the same one? Also, on a side note, does anyone know how to install rospy? Issue right here:https://bitbucket.org/osrf/drcsim/issue/334/unable-to-use-rospy
Just so you know, I think it's the hand brake, when I echoed it before and after the program, it remains the same value of 1.0, but the gas pedal and brake changed to their respective assigned values(i.e. gas pedal 0.0->1.0). The code is still the same on pastebin, so what should I try to get the handbrake working?