Advertisement
Guest User

ekf_localization_2.launch

a guest
Sep 14th, 2015
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 17.38 KB | None | 0 0
  1. <?xml version="1.0"?>
  2.  
  3. <launch>
  4.  
  5.     <!-- This node will take in measurements from odometry, IMU, stamped pose, and stamped twist messages. It tracks
  6.         the state of the robot, with the state vector being defined as X position, Y position, Z position,
  7.         roll, pitch, yaw, their respective velocites, and linear acceleration. Units for all measurements are assumed
  8.         to conform to the SI standard as specified in REP-103. -->
  9.     <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization_2" clear_params="true" output="screen">
  10.  
  11.       <!-- ======== STANDARD PARAMETERS ======== -->
  12.  
  13.       <!-- The frequency, in Hz, at which the filter will output a position estimate. Note that
  14.           the filter will not begin computation until it receives at least one message from
  15.           one of the inputs. It will then run continuously at the frequency specified here,
  16.           regardless of whether it receives more measurements. Defaults to 30 if unspecified. -->
  17.       <param name="frequency" value="50"/>
  18.  
  19.       <!-- The period, in seconds, after which we consider a sensor to have timed out. In this event, we
  20.           carry out a predict cycle on the EKF without correcting it. This parameter can be thought of
  21.           as the minimum frequency with which the filter will generate new output. Defaults to 1 / frequency
  22.           if not specified. -->
  23.       <param name="sensor_timeout" value="0.1"/>
  24.  
  25.       <!-- If this is set to true, no 3D information will be used in your state estimate. Use this if you
  26.           are operating in a planar environment and want to ignore the effect of small variations in the
  27.           ground plane that might otherwise be detected by, for example, an IMU. Defaults to false if
  28.           unspecified. -->
  29.       <param name="two_d_mode" value="true"/>
  30.  
  31.       <!-- REP-105 (http://www.ros.org/reps/rep-0105.html) specifies three principal coordinate frames: map,
  32.           odom, and base_link. base_link is the coordinate frame that is affixed to the robot. The robot's
  33.           position in the odom frame will drift over time, but is accurate in the short term and should be
  34.           continuous. The odom frame is therefore the best frame for executing local motion plans. The map
  35.           frame, like the odom frame, is a world-fixed coordinate frame, and while it contains the most
  36.           globally accurate position estimate for your robot, it is subject to discrete jumps, e.g., due to
  37.           the fusion of GPS data. Here is how to use the following settings:
  38.             1. Set the map_frame, odom_frame, and base_link frames to the appropriate frame names for your system.
  39.                  * If your system does not have a map_frame, just remove it, and make sure "world_frame" is set
  40.                    to the value of odom_frame.
  41.             2. If you are fusing continuous position data such as wheel encoder odometry, visual odometry, or IMU data,
  42.                set "world_frame" to your odom_frame value. This is the default behavior for robot_localization's state
  43.                estimation nodes.
  44.             3. If you are fusing global absolute position data that is subject to discrete jumps (e.g., GPS or position
  45.                updates from landmark observations) then:
  46.                  3a. Set your "world_frame" to your map_frame value
  47.                  3b. MAKE SURE something else is generating the odom->base_link transform. Note that this can even be
  48.                      another instance of robot_localization! However, that instance should *not* fuse the global data. -->
  49.       <!-- Defaults to "map" if unspecified. Krystian note- This should be probably be board1 (tf from aruco markers) -->
  50.       <param name="map_frame" value="map"/>
  51.  
  52.       <!-- Defaults to "odom" if unspecified -->
  53.       <param name="odom_frame" value="odom"/>
  54.  
  55.       <!-- Defaults to "base_link" if unspecified -->
  56.       <param name="base_link_frame" value="base_link"/>
  57.  
  58.       <!-- Defaults to the value of "odom_frame" if unspecified -->
  59.       <param name="world_frame" value="map"/>
  60.  
  61.       <!-- Use this parameter to provide an offset to the transform generated by ekf_localization_node. This
  62.           can be used for future dating the transform, which is required for interaction with some other
  63.           packages. Defaults to 0.0 if unspecified. -->
  64.       <param name="transform_time_offset" value="0.0"/>
  65.  
  66.       <!-- The filter accepts an arbitrary number of inputs from each input message type (Odometry, PoseStamped,
  67.           TwistStamped, Imu). To add a new one, simply append the next number in the sequence to its base name,
  68.           e.g., odom0, odom1, twist0, twist1, imu0, imu1, imu2, etc. The value should be the topic name. These
  69.           parameters obviously have no default values, and must be specified. -->
  70.  
  71.       <param name="odom0" value="odometry/filteredIMU"/>
  72.       <param name="pose0" value="ar_multi_boards/pose"/>
  73.  
  74.  
  75.       <!-- Each sensor reading updates some or all of the filter's state. These options give you greater control over
  76.           which values from each measurement are fed to the filter. For example, if you have an odometry message as input,
  77.           but only want to use its Z position value, then set the entire vector to false, except for the third entry.
  78.           The order of the values is x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. Note that not some
  79.           message types lack certain variables. For example, a TwistWithCovarianceStamped message has no pose information, so
  80.           the first six values would be meaningless in that case. Each vector defaults to all false if unspecified, effectively
  81.           making this parameter required for each sensor. -->
  82.       <rosparam param="odom0_config">[false, false, false,
  83.                                       false, false, false,
  84.                                       true,  false, false,
  85.                                       false, false, true,
  86.                                       false, false, false]</rosparam>
  87. <!--
  88.  
  89.      <rosparam param="odom1_config">[false, false, false,
  90.                                      false, false, false,
  91.                                      true,  false, false,
  92.                                      false, false, false,
  93.                                      false, false, false]</rosparam>
  94. -->
  95.       <rosparam param="pose0_config">[true,  true,  false,
  96.                                       false, false, false,
  97.                                       false, false, false,
  98.                                       false, false, false,
  99.                                       false, false, false]</rosparam>
  100. <!--
  101.      <rosparam param="twist0_config">[false, false, false,
  102.                                       false, false, false,
  103.                                       true,  true,  true,
  104.                                       true,  true,  true,
  105.                                       false, false, false]</rosparam>
  106. -->
  107. <!--       <rosparam param="imu0_config">[true, true, false,
  108.                                     false, false, true,
  109.                                     true,  true,  false,
  110.                                     false,  false,  true,
  111.                                     false, false, false]</rosparam> -->
  112.  
  113.       <!-- The best practice for including new sensors in robot_localization's state estimation nodes is to pass in velocity
  114.           measurements and let the nodes integrate them. However, this isn't always feasible, and so the state estimation
  115.           nodes support fusion of absolute measurements. If you have more than one sensor providing absolute measurements,
  116.           however, you may run into problems if your covariances are not large enough, as the sensors will inevitably
  117.           diverge from one another, causing the filter to jump back and forth rapidly. To combat this situation, you can
  118.           either increase the covariances for the variables in question, or you can simply set the sensor's differential
  119.           parameter to true. When differential mode is enabled, all absolute pose data is converted to velocity data by
  120.           differentiating the absolute pose measurements. These velocities are then integrated as usual. NOTE: this only
  121.           applies to sensors that provide absolute measurements, so setting differential to true for twit measurements has
  122.           no effect.
  123.  
  124.           Users should take care when setting this to true for orientation variables: if you have only one source of
  125.           absolute orientation data, you should not set the differential parameter to true. This is due to the fact that
  126.           integration of velocities leads to slowly increasing error in the absolute (pose) variable. For position variables,
  127.           this is acceptable. For orientation variables, it can lead to trouble. Users should make sure that all orientation
  128.           variables have at least one source of absolute measurement. -->
  129.  
  130.       <param name="odom0_differential" value="false"/>
  131.       <param name="pose0_differential" value="false"/>
  132.  
  133.  
  134.       <!-- When the node starts, if this parameter is true, then the first measurement is treated as a "zero point" for all
  135.           future measurements. While you can achieve the same effect with the differential paremeter, the key difference is
  136.           that the relative parameter doesn't cause the measurement to be converted to a velocity before integrating it. If
  137.           you simply want your measurements to start at 0 for a given sensor, set this to true. -->
  138.  
  139.       <param name="odom0_relative" value="false"/>
  140.       <param name="pose0_relative" value="false"/>
  141.  
  142.  
  143.       <!-- If we're including accelerations in our state estimate, then we'll probably want to remove any acceleration that
  144.           is due to gravity for each IMU. If you don't want to, then set this to false. Defaults to false if unspecified. -->
  145.       <!-- <param name="imu0_remove_gravitational_acceleration" value="false"/> -->
  146.  
  147.       <!-- If you're having trouble, try setting this to true, and then echo the /diagnostics_agg topic to see
  148.           if the node is unhappy with any settings or data. -->
  149.       <param name="print_diagnostics" value="true"/>
  150.  
  151.       <!-- ======== ADVANCED PARAMETERS ======== -->
  152.  
  153.       <!-- Most users will be able to remove these parameters from the launch file without any consequences. We recommend
  154.           that users do not set values for these parameters without having a thorough understanding of
  155.           the parameters do. -->
  156.  
  157.       <!-- By default, the subscription queue size for each message type is 1. If you wish to increase that so as not
  158.           miss any messages (even if your frequency is set to a relatively small value), increase these. -->
  159. <!--
  160.      <param name="odom0_queue_size" value="2"/>
  161.      <param name="odom1_queue_size" value="1"/>
  162.      <param name="pose0_queue_size" value="10"/>
  163.      <param name="twist0_queue_size" value="3"/>
  164.      <param name="imu0_queue_size" value="1"/>
  165. -->
  166.  
  167.       <!-- If your data is subject to outliers, use these threshold settings, expressed as Mahalanobis distances, to control
  168.           how far away from the current vehicle state a sensor measurement is permitted to be. Each defaults to
  169.           numeric_limits<double>::max() if unspecified. -->
  170. <!--
  171.      <param name="odom0_pose_rejection_threshold" value="5"/>
  172.      <param name="odom0_twist_rejection_threshold" value="1"/>
  173.      <param name="pose0_rejection_threshold" value="2"/>
  174.      <param name="twist0_rejection_threshold" value="1.2"/>
  175.  
  176.      <param name="imu0_pose_rejection_threshold" value="0.3"/>
  177.      <param name="imu0_twist_rejection_threshold" value="0.1"/>
  178.      <param name="imu0_linear_acceleration_rejection_threshold" value="0.1"/>
  179. -->
  180.       <!-- Debug settings. Not for the faint of heart. Outputs a ludicrous amount of information to the file
  181.           specified by debug_out_file. I hope you like matrices! Defaults to false if unspecified. -->
  182.       <param name="debug"           value="false"/>
  183.       <!-- Defaults to "robot_localization_debug.txt" if unspecified. -->
  184.       <param name="debug_out_file"  value="debug_ekf_localization.txt"/>
  185.  
  186.       <!-- The process noise covariance matrix can be difficult to tune, and can vary for each application, so it
  187.           is exposed as a configuration parameter. The values are ordered as x, y, z, roll, pitch, yaw, vx, vy, vz,
  188.           vroll, vpitch, vyaw, ax, ay, az. Defaults to the matrix below if unspecified. -->
  189. <!--       <rosparam param="process_noise_covariance">[0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
  190.                                                  0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
  191.                                                  0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
  192.                                                  0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
  193.                                                  0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
  194.                                                  0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
  195.                                                  0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
  196.                                                  0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
  197.                                                  0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
  198.                                                  0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
  199.                                                  0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
  200.                                                  0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
  201.                                                  0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
  202.                                                  0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
  203.                                                  0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]</rosparam> -->
  204.  
  205.       <!-- This represents the initial value for the state estimate error covariance matrix. Setting a diagonal value (a
  206.           variance) to a large value will result in early measurements for that variable being accepted quickly. Users should
  207.           take care not to use large values for variables that will not be measured directly. The values are ordered as x, y,
  208.           z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. Defaults to the matrix below if unspecified. -->
  209. <!--            <rosparam param="initial_estimate_covariance">[1e-9, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
  210.                                                          0,    1e-9, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
  211.                                                          0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
  212.                                                          0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
  213.                                                          0,    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
  214.                                                          0,    0,    0,    0,    0,    1e-9, 0,    0,    0,    0,     0,     0,     0,    0,    0,
  215.                                                          0,    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,     0,     0,     0,    0,    0,
  216.                                                          0,    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,     0,     0,     0,    0,    0,
  217.                                                          0,    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,     0,     0,     0,    0,    0,
  218.                                                          0,    0,    0,    0,    0,    0,    0,    0,    0,    1e-9,  0,     0,     0,    0,    0,
  219.                                                          0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     1e-9,  0,     0,    0,    0,
  220.                                                          0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     1e-9,  0,    0,    0,
  221.                                                          0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     1e-9, 0,    0,
  222.                                                          0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    1e-9, 0,
  223.                                                          0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]</rosparam> -->
  224.  
  225.  
  226.       <!--  Placeholder for output topic remapping
  227.      <remap from="odometry/filtered" to=""/>
  228.      -->
  229.  
  230.     </node>
  231.  
  232. </launch>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement