[with bag file] Use GPS with robot_localization and navsat_transform_node
Hi to all, hi @Tom Moore,
my configuration includes Novatel RTK GPS, Razor IMU and Husky with wheel encoders. I would like to implement a GPS waypoint navigation in ROS by using robot_localization and navsattransformnode as discussed in this previous topic.
My Razor IMU with ROS driver report non-zero values when facing EAST, so I added the yaw_offset
to make the IMU work accordingly with navsat_transform_node
.
My imu topic is: /imu
My GPS topic is: /fix
I tried to modify my control.launch
file in order to add the navsat_transform_node
, but I don't know if it is correct.
I do not know if I correctly handled the two robot_localization
nodes in the control.launch
file.
If I tried to playback my recorded bag file in RVIZ, I receive this error:
Fixed Frame [map] does not exist
No transform from [base_footprint] to frame [map]
If I change the fixed_frame
to odom
, I see my robot jumping randomly in RVIZ without any reason.
If I set fixed_frame
to map
, I get this error:
[ERROR] [1489506379.984277505, 45.920000000]: Could not obtain transform from odom->base_link
May be I did some mistake with the frames, can you please give me some suggestions on how to solve this problem? Do you have the possibility to run my bag file?
If I change the world_frame
in test.yam
l file, I get an error when I launch the Husky control.launch
file.
Can you please give me any suggestions, please?
EDIT1: I added the magnetic declination for the GPS.
My control.launch file:
<?xml version="1.0"?>
<launch>
<rosparam command="load" file="$(find husky_control)/config/control.yaml" />
<node name="base_controller_spawner" pkg="controller_manager" type="spawner" args="husky_joint_publisher husky_velocity_controller --shutdown-timeout 3"/>
<node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform_node" respawn="true">
<param name="magnetic_declination_radians" value="0.0640"/>
<param name="yaw_offset" value="1.5707963"/>
<remap from="/imu/data" to="/imu" />
<remap from="/gps/fix" to="/fix" />
<remap from="/odometry/filtered" to="/odometry/filtered" />
</node>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
<rosparam command="load" file="$(find husky_control)/config/test.yaml" />
<param name="two_d_mode" value="false"/>
</node>
<node pkg="interactive_marker_twist_server" type="marker_server" name="twist_marker_server" output="screen"/>
<node pkg="twist_mux" type="twist_mux" name="twist_mux">
<rosparam command="load" file="$(find husky_control)/config/twist_mux.yaml" />
<remap from="cmd_vel_out" to="husky_velocity_controller/cmd_vel"/>
</node>
<node pkg="tf" type="static_transform_publisher" name="base_to_realsense"
args="-0.3 0 1.1 1.5 3.14 1.5 /front_bumper_link /realsense_frame 100" />
<node pkg="tf" type="static_transform_publisher" name="base_to_laser"
args="-0.3 0 0.6 0 0 0 /front_bumper_link /laser 100" />
<node pkg="tf" type="static_transform_publisher" name="base_to_color"
args="0 0 0 0 0 0 /realsense_frame /camera_color_optical_frame 100" />
<node pkg="tf" type="static_transform_publisher" name="base_to_depth"
args="0 0 0 0 0 0 /realsense_frame /camera_depth_optical_frame 100" />
<!-- <node pkg="tf" type="static_transform_publisher" name="base_to_imu"
args="0 0 0 0 0 0 /imu_link /base_imu 100" /> -->
<node pkg="tf" type="static_transform_publisher" name="base_to_gps"
args="-0.3 0 0.9 0 0 0 /front_bumper_link /gps 100" />
<node pkg="tf" type="static_transform_publisher" name="base_to_imu"
args="0 0 0 0 0 0 /base_link /base_imu_link 100" />
</launch>
My test.yaml file:
map_frame: map
odom_frame: odom
base_link_frame: base_link
world_frame: odom
two_d_mode: false
frequency: 50
odom0: husky_velocity_controller/odom
odom0_config: [true, true, false,
false, false, true,
true, false, false,
false, false, true,
false, false, false]
odom0_differential: false
odom0_queue_size: 10
imu0: imu
imu0_config: [false, false, false,
true, true, true,
false, false, false,
true, true, true,
true, true, true]
imu0_differential: false
imu0_queue_size: 10
imu0_remove_gravitational_acceleration: true
odom1: odometry/gps
odom1_config: [true, true, true,
false, false, false,
false, false, false,
false, false, false,
false, false, false]
odom1_differential: false
Asked by Marcus Barnet on 2017-03-05 15:40:32 UTC
Comments
I tried to run the code, but I get strange behaviors in RVIZ. When I load the imu values into RVIZ, the robot frame disappears. May be I mounted the IMU in the wrong way? Now, the IMU x-axis faces the front bumper of the robot. Is it correct?
Asked by Marcus Barnet on 2017-03-06 14:24:53 UTC
I edited my first message in order to add the reference for each frame and the magnetic declination. Can you tell me if it is correct please?
Asked by Marcus Barnet on 2017-03-11 10:54:04 UTC
I added the RVIZ screenshot and a recorded bag file with
/fix
and/imu
topics in addition to the Husky topics.Asked by Marcus Barnet on 2017-03-14 10:38:53 UTC
Hi, can you solve the problem?. I'm newbie in ROS, and now I'm triying to configure the navsat_transform_node and ekf_localization_node for an UM7 orientation sensor and an Adafruit Ultimate GPS Breakout. I based my configuration in your examples but I have some problems with the tf/ and frames_id
Asked by Razek on 2017-03-22 14:20:47 UTC
You may add an image of rqt_graph of your system ?
Asked by Razek on 2017-03-22 14:24:41 UTC
My code is not working, I didn't solved my problem, so you should not use it! I'm sorry! I'm waiting for a solution..
Asked by Marcus Barnet on 2017-03-22 14:37:42 UTC
Thanks Marcus for your fast response
Asked by Razek on 2017-03-22 15:15:31 UTC
Try to follow this other topic: http://answers.ros.org/question/257541/strange-results-with-robot_localization-and-navsat_transform_node/ I hope someone will answer so we can solve our problem!
Asked by Marcus Barnet on 2017-03-22 15:32:46 UTC
Is this related to your other question? If so, can you please refer to the other question and close this one?
Asked by Tom Moore on 2017-05-04 02:20:49 UTC
This problem was related to my old IMU which was different from the one i'm using now. So we can consider it as solved. I'm closing it, I just need some clarifications on my last question.
Asked by Marcus Barnet on 2017-05-04 02:29:54 UTC