0
$\begingroup$

Rosanswers logo

image description

I dont know why the begin point away from the origin point from map-frame.

I have set the first gps point for datum.

my params of map and gps:

ekf_se_map:
  frequency: 30
  sensor_timeout: 0.1
  two_d_mode: true
  transform_time_offset: 0.0
  transform_timeout: 0.0
  print_diagnostics: true
  debug: false

  map_frame: map
  odom_frame: odom
  base_link_frame: base_footprint
  world_frame: map

  odom0: odom
  odom0_config: [false,  false,  false,
             false, false, false,
             true, true, true,
             false, false, true,
             false, false, false]
  odom0_queue_size: 10
  odom0_nodelay: true
  odom0_differential: false
  odom0_relative: false
  odom0_pose_rejection_threshold: 1
  odom0_twist_rejection_threshold: 1

  odom1: odometry/gps
  odom1_config: [true,  true,  false,
             false, false, false,
             false, false, false,
             false, false, false,
             false, false, false]
  odom1_queue_size: 10
  odom1_nodelay: false
  odom1_differential: false
  odom1_relative: false
  # odom1_pose_rejection_threshold: 5

  imu0: imu
  imu0_config: [false, false, false,
            false, false,  true,
            false, false, false,
            true,  true,  true,
            true,  true,  true]
  imu0_nodelay: true
  imu0_differential: false
  imu0_relative: false
  imu0_queue_size: 10
  imu0_remove_gravitational_acceleration: true
  imu0_pose_rejection_threshold: 0.8
  imu0_twist_rejection_threshold: 0.8
  imu0_linear_acceleration_rejection_threshold: 0.8

  use_control: false

  process_noise_covariance: [0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                         0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                         0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                         0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                         0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                         0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                         0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
                         0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
                         0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
                         0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
                         0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
                         0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
    

                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
                             0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
                             0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]

      initial_estimate_covariance: [1.0,  0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                0,    1.0,  0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                0,    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                0,    0,    0,    0,    0,    1e-9, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                                0,    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,     0,     0,     0,    0,    0,
                                0,    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,     0,     0,     0,    0,    0,
                                0,    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,     0,     0,     0,    0,    0,
                                0,    0,    0,    0,    0,    0,    0,    0,    0,    1e-9,  0,     0,     0,    0,    0,
                                0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     1e-9,  0,     0,    0,    0,
                                0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     1e-9,  0,    0,    0,
                                    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     1e-9, 0,    0,
                                    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    1e-9, 0,
                                    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]

navsat_transform:
  frequency: 1
  delay: 0
  magnetic_declination_radians: 0 #0.104196156  # For lat/long 55.944831, -3.186998 31.2630568333, 121.616275333
  yaw_offset: 0  
  zero_altitude: true
  broadcast_utm_transform: true
  publish_filtered_gps: false
  use_odometry_yaw: false
  wait_for_datum: true
  datum: [31.2630568333, 121.616275333, 0.46715]

Originally posted by wings0728 on ROS Answers with karma: 50 on 2017-11-27

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Please post a sample message for every sensor input.

In the meantime, what was your first GPS message? If you set a datum, navsat_transform_node assumes that datum is your robot's "initial" GPS reading. All other poses will be computed relative to that pose. So if your first GPS reading was tens of meters away from 31.2630568333, 121.616275333, then the output will reflect that.

If you want your robot to start at (0, 0) in the map frame, then you need to either set the datum to your robot's starting location, or remove the datum parameter from your configuration (making sure to delete that parameter from the parameter server!) and just let the robot's first GPS fix location act as the origin.


Originally posted by Tom Moore with karma: 13689 on 2018-01-29

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.