AaronMR / Learning_ROS_for_Robotics_Programming_2nd_edition

Code and examples for Learning ROS for Robotics Programming - 2nd Edition
450 stars 307 forks source link

change 4 wheels to 3 wheels #19

Open kfbixc opened 8 years ago

kfbixc commented 8 years ago

hello, I run roslaunch chapter9_tutorials chapter9_configuration_gazebo.launch and roslaunch chapter9_tutorials chapter9_configuration_gazebo.launch in chapter 9. It works on succeed.

your car has 4 wheels in your example.But I want to change 4 wheels to 3 wheels.

I put the car into 3 wheels and change plugin libgazebo_ros_skid_steer_drive.so to libgazebo_ros_diff_drive.so.

Then I run my .launch file.But it can't works.I wonder where is wrong? So that I can find errors.

exbot@action-Ubuntu:~$ roslaunch urdf_tutorial service_robotx.launch ... logging to /home/exbot/.ros/log/a986ee4a-c65c-11e5-9d65-00404538febd/roslaunch-action-Ubuntu-29673.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://action-Ubuntu:56306/

SUMMARY

PARAMETERS

NODES / gazebo (gazebo_ros/gzserver) joint_state_publisher (joint_state_publisher/joint_state_publisher) robot_state_publisher (robot_state_publisher/robot_state_publisher) rviz (rviz/rviz) spawn_robot (gazebo_ros/spawn_model)

auto-starting new master process[master]: started with pid [29688] ROS_MASTER_URI=http://localhost:11311

setting /run_id to a986ee4a-c65c-11e5-9d65-00404538febd process[rosout-1]: started with pid [29701] started core service [/rosout] process[gazebo-2]: started with pid [29705] process[joint_state_publisher-3]: started with pid [29716] process[robot_state_publisher-4]: started with pid [29720] process[spawn_robot-5]: started with pid [29724] [ WARN] [1454053699.576836263]: The root link base_footprint has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. process[rviz-6]: started with pid [29759] Gazebo multi-robot simulator, version 2.2.3 Copyright (C) 2012-2014 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org

[ INFO] [1454053699.909351162]: Finished loading Gazebo ROS API Plugin. [1;[ INFO] [1454053699.910592988]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... 32mMsg Waiting for master Msg Connected to gazebo master @ http://127.0.0.1:11345 Msg Publicized address: 192.168.1.107 spawn_model script started [INFO] [WallTime: 1454053700.235329] [0.000000] Loading model xml from ros parameter [INFO] [WallTime: 1454053700.238664] [0.000000] Waiting for service /gazebo/spawn_urdf_model [INFO] [WallTime: 1454053700.241862] [0.000000] Calling service /gazebo/spawn_urdf_model [ INFO] [1454053701.862117756, 0.001000000]: Laser Plugin (robotNamespace = /), Info: Using the 'robotNamespace' param: '/' [ INFO] [1454053701.862253741, 0.001000000]: Starting Laser Plugin (ns = /)! [ INFO] [1454053701.863788869, 0.001000000]: Laser Plugin (ns = /) , set to "" [INFO] [WallTime: 1454053701.865482] [0.001000] Spawn status: SpawnModel: Successfully spawned model [ INFO] [1454053701.908150926, 0.001000000]: Loading gazebo_ros_control plugin [ INFO] [1454053701.908270058, 0.001000000]: Starting gazebo_ros_control plugin in namespace: /robot [ INFO] [1454053701.908983627, 0.001000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server. [spawn_robot-5] process has finished cleanly log file: /home/exbot/.ros/log/a986ee4a-c65c-11e5-9d65-00404538febd/spawn_robot-5*.log [ INFO] [1454053702.134028452, 0.001000000]: Loaded gazebo_ros_control. [ INFO] [1454053702.137565566, 0.001000000]: Starting plugin DiffDrive(ns = //)! [ WARN] [1454053702.137646123, 0.001000000]: DiffDrive(ns = //): missing default is na [ INFO] [1454053702.138981813, 0.001000000]: DiffDrive(ns = //): = [ WARN] [1454053702.139215566, 0.001000000]: DiffDrive(ns = //): missing default is false [ WARN] [1454053702.139251598, 0.001000000]: DiffDrive(ns = //): missing default is false [ WARN] [1454053702.139341744, 0.001000000]: DiffDrive(ns = //): missing default is 0 [ WARN] [1454053702.139375080, 0.001000000]: DiffDrive(ns = //): missing default is 5 [ WARN] [1454053702.139500651, 0.001000000]: DiffDrive(ns = //): missing default is 1 [ WARN] [1454053702.139582562, 0.001000000]: GazeboRosDiffDrive Plugin (ns = ) missing , defaults to 1 [ INFO] [1454053702.140966197, 0.001000000]: DiffDrive(ns = //): Try to subscribe to cmd_vel! [ INFO] [1454053702.145879464, 0.001000000]: DiffDrive(ns = //): Subscribe to cmd_vel! [ INFO] [1454053702.146724916, 0.001000000]: DiffDrive(ns = //): Advertise odom on odom ! [ INFO] [1454053702.168427005, 0.022000000]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO] [1454053702.217701197, 0.069000000]: Physics dynamic reconfigure ready.

exbot@action-Ubuntu:~$ roslaunch urdf_tutorial move_base.launch ... logging to /home/exbot/.ros/log/a986ee4a-c65c-11e5-9d65-00404538febd/roslaunch-action-Ubuntu-30279.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://action-Ubuntu:45686/

SUMMARY

PARAMETERS

NODES / amcl (amcl/amcl) map_server (map_server/map_server) move_base (move_base/move_base)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found process[map_server-1]: started with pid [30297] process[amcl-2]: started with pid [30298] process[move_base-3]: started with pid [30299] [ INFO] [1454053785.767251271]: Loading map from image "/home/exbot/exercise_ws/src/urdf_tutorial/maps/map.pgm" [ INFO] [1454053785.904421814]: Requesting the map... [ WARN] [1454053785.908913035]: Request for map failed; trying again... [ INFO] [1454053785.969457683]: Read a 4000 X 4000 map @ 0.050 m/cell [ WARN] [1454053786.008106667, 83.481000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 83.481 timeout was 0.1. [ INFO] [1454053786.504449542, 83.978000000]: Sending map [ INFO] [1454053786.538720846, 84.002000000]: Received a 4000 X 4000 map @ 0.050 m/pix

[ INFO] [1454053786.743236283, 84.205000000]: Initializing likelihood field model; this can take some time on large maps... [ INFO] [1454053786.925931934, 84.384000000]: Done initializing likelihood field model. [ WARN] [1454053791.116613930, 88.550000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 0.1 timeout was 0.1. [ WARN] [1454053796.203622617, 93.607000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 0.102 timeout was 0.1. [ WARN] [1454053801.279153197, 98.660000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 0.1 timeout was 0.1. [ WARN] [1454053802.155324605, 99.530000000]: No laser scan received (and thus no pose updates have been published) for 99.530000 seconds. Verify that data is being published on the /scan topic. [ WARN] [1454053806.370387338, 103.727000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 0.101 timeout was 0.1. [ WARN] [1454053811.452745478, 108.786000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 0.101 timeout was 0.1. ^C[move_base-3] killing on exit [amcl-2] killing on exit [map_server-1] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done

Following is my plugin libgazebo_ros_diff_drive.so qq 20160129163802 Thank you.

efernandez commented 8 years ago

Looks like the robotNamespace shouldn't have the / and I don't think the left and right joint names are correct.

This is different from the code/URDF from the book, so if you want me to help you, you'll have to create a fork of the repo and push the changes in your fork. Otherwise, I have no way to reproduce it and fix.

efernandez commented 8 years ago

ping @KFBIT

I you're not able to provide the code to reproduce this, I'd have to close this issue because I can't reproduce it.

Also note that this change is out of the scope of the things on the book, so it's difficult to help you with it.