ctu-mrs / mrs_simulation

The ROS part of the "simulation" package.
https://github.com/ctu-mrs/simulation
BSD 3-Clause "New" or "Revised" License
12 stars 14 forks source link

can not add second IMU with xacro:imu_plugin_macro #14

Closed maxhofidrone closed 2 years ago

maxhofidrone commented 3 years ago

Hello, I want to simulate a second IMU at the T650. For that I want to use the same macro (in component_snippets.xacro) you used for the normal standard IMU (IMU (ADIS16448)). Adding an additional sensor to spawner_params.yaml and t650.xacro works fine. Within t650.xacro I just copy paste the existing IMU and change following lines:

<xacro:imu_plugin_macro
    namespace="test"
    imu_suffix="new"
    parent_link="base_link"
    imu_topic="/imu_new" 
    .
    .
    .
 </xacro:imu_plugin_macro>

The other IMU specific parameters are unchanged for the moment. Spawning by an adopted one_drownbaro session (I added the --enable-new-imu) does not show any errors, but I am never able to see the new /imunew ROS topic. Furthermore I am also never able to see the original /imu ROS topic nor finding its remapping of the topic name. Can someone please give me some help what I am doing wrong here?

Thank you very much in advance!

Max

maxhofidrone commented 3 years ago

Additionally I also added an IMU with a different IMU plugin which works fine and I am able to see the new topic. But as it misses the additional IMU parameters of the first example, I don't want to use this example.

stibipet commented 3 years ago

Hello Max,

we have also stumbled upon the limitations of the plugin you mentioned. I have recently added a component snippet, which uses a more configurable IMU plugin. You fill find it under "custom_imu_macro" in the component_snippets.xacro. Some inspiration on how to set it up may be found in the "vio_macro" block (also in component_snippets), which uses the newly added plugin.

    <xacro:custom_imu_macro
      namespace="..."
      parent_link="..."
      sensor_name="..."
      update_rate="..."
      topic_name="..."
      noise_mean="..."
      >
      <origin xyz="0 0 0" rpy="0 0 0"/>
    </xacro:custom_imu_macro>

Petr

spurnvoj commented 2 years ago

Hi, I am closing this issue. If you still have some questions, feel free to open it again. :)