I took a look at your bag and launch files. It is true that the navsat_transform
node is not publishing any messages to /odometry/gps
, even though it is getting input data. One possible cause is the error in your task tree that is being reported: the transform from imu0
to base_link
is unknown. You have a static_transform_publisher for this in your launch file on line 10, but you have the frames around the wrong way, which means that it is saying that base_link
is a child of imu0
. Swap the frames on this line.
To fix the problem with nmea_navsat_driver
prefixing its task frame with a slash, you need to use a version of the driver with the change specified in this pull request applied.
Until that change is applied you will need to patch the driver yourself, which requires adding a local copy of it to your workspace to override the version installed with ROS.
In your workspace's src
directory, clone a copy of the driver's source:
git clone https://github.com/ros-drivers/nmea_navsat_driver.git
Here is the patch that will stop it adding the slash. Save that file as no_to_slashes.patch
, go to <your workspace>/src/nmea_navsat_driver
, and then run the following command (modifying the path to no_to_slashes.patch
as necessary):
patch -p1 < no_to_slashes.patch
(The -p1
strips the first directory from the paths specified in the path file, in this case a/
and b/
; without this the patch command won't be able to find the file to modify.)
Then you should be able to compile your workspace and when you use the nmea_navsat_driver
it will use your local, patched copy.
Once that pull request goes through, you will not need your modified version of the driver any more. But until a release is made of the fixed version you will still need to keep a copy of the driver source (cloned from Github without modifications) in your workspace so that the fixed version overrides the broken version installed using apt.
Originally posted by Geoff with karma: 4203 on 2017-04-20
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Pietro on 2017-04-21:
i have this:
Comment by Pietro on 2017-04-21:
but i receive this warning:
Could not obtain transform from imu0 to base_link. Error was Could not find a connection between 'base_link' and 'imu0' because they are not part of the same tree.Tf has two or more unconnected trees.
Comment by Geoff on 2017-04-21:
You're right, you do. Sorry, I missed that in your launch file. Anyway, the problem there is that you have the frames around the wrong way. You are telling tf that base_link
is a child of imu0
. Try swapping the frames.
Comment by Pietro on 2017-04-26:
tank you, but now i have this warn:
[ WARN] : Could not obtain transform from /gps to base_link. Error was Invalid argument "/gps" passed to lookupTransform argument source_frame in tf2 frame_ids cannot start with a '/' like
i try to add a node for transformation but not working
Comment by Geoff on 2017-04-26:
In tf2, frames are no longer allowed to start with a slash. I looked in your bag file and some of your topics are using the frame /gps
. What published the /fix0
, /fix1
and /vel
topics when you recorded your bag file?
Comment by Pietro on 2017-04-27:
/fix0 and /fix1 are message from two different GPS for /vel I ask and I let you know
Thanks
Comment by Geoff on 2017-04-27:
OK, you need to check what the frames for those are set to in their driving nodes. If the frame starts with a slash, remove the slash. The same goes for whatever is publishing /vel
.
Comment by Pietro on 2017-04-27:
for gps i use this node:
rosrun nmea_navsat_driver nmea_serial_driver _port:=/dev/ttyACM0 fix:=fix0 __name:=gps0
rosrun nmea_navsat_driver nmea_serial_driver _port:=/dev/ttyACM1 fix:=fix1 __name:=gps1
Comment by Pietro on 2017-04-27:
this is the problem i opened: https://github.com/ros-drivers/nmea_navsat_driver/issues/35
for name_navsat_driver.
and for the /vel is publishing from the gps node
Comment by Pietro on 2017-04-27:
I noticed this other issues for the same problem:
https://github.com/ros-drivers/nmea_navsat_driver/issues/31
https://github.com/ros-drivers/nmea_navsat_driver/issues/24
https://github.com/ros-drivers/nmea_navsat_driver/pull/33
Comment by Pietro on 2017-04-29:
Tanks for all your replay
Next week i can try on the robot but in the meantime i try to remove the /.
I found this http://wiki.ros.org/bag_tools
i run this command
rosrun bag_tools change_frame_id.py -o prova.bag -i u5-fuori10hzlungocoperto.bag -f gps -t /fix0 /fix1 /vel
and it works!
Comment by Pietro on 2017-04-29:
with new bag is going better but i receive this error:
Could not obtain transform from odom->base_link
i add a transformation for odom to base_link? with tf2_ros and with what parameters?
https://www.dropbox.com/s/w9tdui3l768tc2i/prova.bag?dl=0