#
#           █████╗ ████████╗ ██████╗ ███╗   ███╗
#          ██╔══██╗╚══██╔══╝██╔═══██╗████╗ ████║
#          ███████║   ██║   ██║   ██║██╔████╔██║
#          ██╔══██║   ██║   ██║   ██║██║╚██╔╝██║
#   __     ██║  ██║   ██║   ╚██████╔╝██║ ╚═╝ ██║    _
#  / _|    ╚═╝  ╚═╝   ╚═╝    ╚═════╝ ╚═╝     ╚═╝   | |
#  | |_ _ __ __ _ _ __ ___   _____      _____  _ __| | __
#  |  _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ /
#  | | | | | (_| | | | | | |  __/\ V  V / (_) | |  |   <
#  |_| |_|  \__,_|_| |_| |_|\___| \_/\_/ \___/|_|  |_|\_\
#  https://github.com/lardemua/atom
# Auto-generated file on {{ c.date }}

# This yaml file describes your calibration!


# Start by defining your robotic system.
# This is the URDF file (or xacro) that describes your robot.
# Every time a path to a file is requested you can use
#
#   - Absolute Path
#       Example 1: /home/user/ros_workspace/your_package/urdf/description.urdf.xacro
#       Example 2: file://home/user/ros_workspace/your_package/urdf/description.urdf.xacro
#
#   - Path Expansion
#       Example 1: ${HOME}/user/${YOUR_VARIABLE}/your_package/urdf/description.urdf.xacro
#       Example 2: ~/user/ros_workspace/your_package/urdf/description.urdf.xacro
#
#       NOTE: It is up to you to guarantee the environment variable exists.
#
#   - ROS Package Reference
#       Example: package://your_package/urdf/description.urdf.xacro
#
description_file: "{{ c.description_file }}"

# The calibration framework requires a bagfile to extract the necessary data for the calibration.
bag_file: "{{ c.bag_file }}"

# You must define a frame of reference for the optimization process.
# It must exist in the transformation chains of all the sensors which are being calibrated.
world_link: "{{ c.world_link }}"

# ATOM will calibrate the extrinsic parameters of your sensors.
# In this section you should discriminate the sensors that will be part of the calibrations.
sensors:
  # Each key will define a sensor and its name, which will be use throughout the calibration.
  # Each sensor definition must have the following properties:
  #       link:
  #           The frame of the sensor's data (i.e. the header.frame_id).
  #       parent_link:
  #           The parent link of the transformation (i.e. link) to be calibrated.
  #       child_link:
  #           This is the transformation (i.e. link) that we be optimized.
  #       topic_name:
  #           Name of the ROS topic that contains the data produced by this sensor.
  #           If you are calibrating an camera, you should use the raw image produced by the
  #           sensors. Additionally, it the topic is an image it will automatically use the
  #           respective `camera_info` topic.
  #       modality:
  #           Set this to identify the sensor modality. If this flag is not set, the sensor will be
  #           identified by the message type.
  #           Current options: lidar3d, rgb, depth, lidar2d
  #       throttle:
  #           Set throttle: desired_frame_rate. If you don't use throttle, do not enter a value, i.e. "throttle: "
  #
  # If you are using an image compressed topic such as:
  #   /world_camera/rgb/image_raw/compressed
  # you should not add the "compressed" part, use only:
  #   /world_camera/rgb/image_raw
  {% for sensor_key, sensor_value in c.sensors.items() %}
  {{ sensor_key }}:
    {%- for prop_key, prop_value in sensor_value.items() %}
    {%- if prop_value is not none and prop_key != 'throttle' %}
    {{ prop_key }}: "{{ prop_value }}"
    {%- elif prop_value is none%}
    {{ prop_key }}:
    {%- elif prop_key == 'throttle' %}
    {{ prop_key }}: {{ prop_value }}
    {%- endif %}
    {%- endfor %}
  {% endfor %}

# ATOM will calibrate the extrinsic parameters of your links.
# In this section you should discriminate the additional transformations that will be part of the calibrations.
additional_tfs:
  # Each key will define a transformations and its name, which will be use throughout the calibration.
  # Each additional transformations definition must have the following properties:
  #
  #       parent_link:
  #           The parent link of the transformation (i.e. link) to be calibrated.
  #
  #       child_link:
  #           This is the transformation (i.e. link) that we be optimized.
  #
  # EXAMPLE:
  #base_footprint_to_base_link:
  #  parent_link: "base_footprint"
  #  child_link: "base_link"
  {%- if c.additional_tfs.items is defined -%}
  {% for additional_tf_key, additional_tf_value in c.additional_tfs.items() %}
  {{ additional_tf_key }}:
    {%- for prop_key, prop_value in additional_tf_value.items() %}
    {{ prop_key }}: "{{ prop_value }}"
    {%- endfor %}
  {% endfor %}
  {% endif %}


# ATOM can also calibrate several parameters of your joints.
# In this section you should discriminate the joints that will be part of the calibrations.
# For each joint you must specify which parameters to optimize.
# The joint is identified by its name, consistent with the URDF description.
joints:
  # Each key will define a joint and its name, which will be use throughout the calibration.
  # Each joint definition must have the following properties:
  #
  #       params_to_calibrate:
  #           This is the list of parameters that will be optimized, from the urdf definition (http://wiki.ros.org/urdf/XML/joint):
  #           ['origin_x', 'origin_y', 'origin_z', 'origin_roll', 'origin_pitch', 'origin_yaw']
  #
  # EXAMPLE:
  #head_pan_joint:
  #  params_to_calibrate: ['origin_yaw']
  {%- if c.joints.items is defined -%}
  {% for joint_key, joint_value in c.joints.items() %}
  {{ joint_key }}:
    {%- for prop_key, prop_value in joint_value.items() %}
    {{ prop_key }}: {{ prop_value }}
    {%- endfor %}
  {% endfor %}
  {% endif %}

# The calibration requires a detectable pattern.
# This section describes the properties of the calibration pattern used in the calibration.
calibration_patterns:
  {%- if c.calibration_patterns.items is defined -%}
  {% for calibration_pattern_key, calibration_pattern_value in c.calibration_patterns.items() %}
  {{ calibration_pattern_key }}:
    {%- for prop_key, prop_value in calibration_pattern_value.items() %}
    {%- if prop_key is not in ['fixed', 'border_size', 'dimension', 'size', 'inner_size'] %}
    {{ prop_key }}: "{{ prop_value }}"
    {%- else %}
    {{ prop_key }}: {{ prop_value }}
    {%- endif %}
    {%- endfor %}
  {%- endfor -%}
  {% endif %}

# Miscellaneous configuration

# If your calibration problem is not fully constrained you should anchored one of the sensors.
# This makes it immovable during the optimization.
# This is typically referred to as gauge freedom.
{%- if c.anchored_sensor is not none %}
anchored_sensor: "{{ c.anchored_sensor }}"
{%- else %}
anchored_sensor:
{%- endif %}

# Max time delta (in milliseconds) between sensor data messages when creating a collection.
max_duration_between_msgs: {{ c.max_duration_between_msgs }}

# This parameter is automatically filled by ATOM, please only change if you know what you are doing
package_name: "{{ c.package_name }}"

# Automatically filled. Do not touch unless you know what you are doing.
version: {{ c.version }}
