Robotics StackExchange | Archived questions

Attaching a sensor to a PARTICULAR LINK of an animated actor

Hello, that's my first question here.

I'm currently having a really hard time trying to find out a way to connect an IMU sensor to a certain link of an animated actor. I've been experimenting a lot and now I'm posting my last piece of code below. I ended up with IMU as a big cube (just for better visualization) attached to actor's body but not to the link I wanted (RightLeg), check out the picture.

The IMU link does not appear on the Gazebo links list in /actor1/* list. I'm pretty sure that code's template is right but there is probably something wrong with syntax. I don't get any errors while launching the .world file that contains following code:

<actor name="actor1">
  <pose>0 1 1.25 0 0 0</pose>
  <skin>
    <filename>walk.dae</filename>
    <scale>1.0</scale>
  </skin>
  <link name="imu_base">
    <frame name="imu_leg">
      <pose frame="actor1::RightLeg">0 0 0 0 0 0</pose>
    </frame>
    <pose>0 0 0 0 0 0</pose>
    <visual name="imu_base_visual">
      <pose>0 0 0 0 0 0</pose>
      <geometry>
        <box>
          <size>0.2 0.2 0.2</size> <!-- EASIER DEBUGGING -->
        </box>
      </geometry>
      <material>
        <script>
          <uri>model://actor_imu/materials/actor_imu.material</uri>
          <name>actor_imu/base</name>
        </script>
      </material>
    </visual>
    <sensor name="actor_imu" type="imu">
      <visualize>true</visualize>
      <plugin name="actor_imu" filename="libactor_imu.so"/>
      <update_rate>100</update_rate> <!-- EASIER DEBUGGING -->
      <always_on>1</always_on>
    </sensor>
  </link>
  <joint name="actor1::imu_fix" type="fixed">
    <parent>actor1::RightLeg</parent>
    <child>imu_base</child>
  </joint>
  <animation name="walking">
    <filename>walk.dae</filename>
    <scale>1.000000</scale>
    <interpolate_x>true</interpolate_x>
  </animation>
  <plugin name="actor1_plugin" filename="libActorPlugin.so">
    <target>0 -5 1.2138</target>
    <target_weight>1.15</target_weight>
    <obstacle_weight>1.8</obstacle_weight>
    <animation_factor>5.1</animation_factor>
    <ignore_obstacles>
      <model>cafe</model>
      <model>ground_plane</model>
    </ignore_obstacles>
  </plugin>
</actor>

IMU attached to 0,0,0 of an actor

I checked other questions before, it is kind of related to 15389 and 14006.

Thanks in advance

EDIT: As @chapulina suggested, I ran gazebo in verbose mode and this is the output:

[Wrn] [GuiIface.cc:196] g/gui-plugin is really loading a SystemPlugin. To load a GUI plugin please use --gui-client-plugin 
[ INFO] [1544379941.319388836]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1544379941.320842043]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1544379941.391440800]: Finished loading Gazebo ROS API Plugin.
[Msg] Waiting for master.
[ INFO] [1544379941.392690107]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.1.156
[Err] [InsertModelWidget.cc:336] Missing model.config for model "/home/rayvburn/ped_sim_ws/src/incare_people_sim/actor_imu/materials"
[Err] [InsertModelWidget.cc:336] Missing model.config for model "/home/rayvburn/ped_sim_ws/src/incare_people_sim/actor_imu/src"
[Err] [InsertModelWidget.cc:336] Missing model.config for model "/home/rayvburn/ped_sim_ws/src/people_sim/turtlebot3_simulations/turtlebot3_gazebo/models/turtlebot3_autorace"
[ INFO] [1544379942.355888232]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1544379942.371552291]: waitForService: Service [/gazebo/set_physics_properties] is now available.
IMU sensor succesfully found
[ INFO] [1544379942.476708789]: Physics dynamic reconfigure ready.
[ INFO] [1544379942.477415066]: Physics dynamic reconfigure ready.
[Wrn] [GuiIface.cc:117] void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&File" under id 56
[Wrn] [GuiIface.cc:117] void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&Edit" under id 59
[Wrn] [GuiIface.cc:117] void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&Camera" under id 61
[Wrn] [GuiIface.cc:117] void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&View" under id 64
[Wrn] [GuiIface.cc:117] void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&Window" under id 68
[Wrn] [GuiIface.cc:117] void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&Help" under id 73
[Msg] Waiting for model database update to complete...
[Err] [ModelDatabase.cc:414] Unable to download model[model://actor_imu/materials/actor_imu.material]
[Err] [SystemPaths.cc:449] File or path does not exist[""]
[Err] [RenderEngine.cc:475] URI doesn't exist[model://actor_imu/materials/actor_imu.material]
[Wrn] [Visual.cc:1076] Unable to get Material[actor_imu/base] for Geometry[actor1::actor1_pose::imu_base_visual. Object will appear white
[Err] [ModelDatabase.cc:414] Unable to download model[model://actor_imu/materials/actor_imu.material]
[Err] [SystemPaths.cc:449] File or path does not exist[""]
[Err] [RenderEngine.cc:475] URI doesn't exist[model://actor_imu/materials/actor_imu.material]
[Err] [ModelDatabase.cc:414] Unable to download model[model://actor_imu/materials/actor_imu.material]
[Err] [SystemPaths.cc:449] File or path does not exist[""]
[Err] [RenderEngine.cc:475] URI doesn't exist[model://actor_imu/materials/actor_imu.material]
[Err] [ModelDatabase.cc:414] Unable to download model[model://actor_imu/materials/actor_imu.material]
[Err] [SystemPaths.cc:449] File or path does not exist[""]
[Err] [RenderEngine.cc:475] URI doesn't exist[model://actor_imu/materials/actor_imu.material]

It's strange that it couldn't find the material. materials/actor_imu.material is in actor_imu folder and model.config is directly in the actor_imu folder. I also don't get why it tries to look for model.config in another package turtlebot3_simulations.

This is what I put in the .bashrc:

export CATKIN_WS_PATH=${HOME}/ped_sim_ws
export GAZEBO_MODEL_PATH=${CATKIN_WS_PATH}/src/incare_people_sim/actor_imu:$GAZEBO_MODEL_PATH

Any further suggestions?

Asked by rayvburn on 2018-12-08 18:50:10 UTC

Comments

GAZEBO_MODEL_PATH has to be the model folder's parent dir, so you can try export GAZEBO_MODEL_PATH=${CATKIN_WS_PATH}/src/incare_people_sim:$GAZEBO_MODEL_PATH

Asked by chapulina on 2018-12-10 12:19:39 UTC

Unfortunately, after change you suggested I'm still getting the same error. I think that I will get over with directly attaching IMU to an actor. Thank you very much @chapulina

Asked by rayvburn on 2018-12-10 17:16:05 UTC

Answers

Welcome to Gazebo Answers :)

I don't get any errors while launching the .world file

Are you running Gazebo in verbose mode? Like gazebo --verbose? Because you should be getting something like

[Err] [Joint.cc:265] EXCEPTION: Couldn't Find Parent Link[imu_base]

connect an IMU sensor to a certain link of an animated actor

I did some testing here, and it looks that when you have both <link>s and <skin>s in an actor, the <link>s are not showing on the left panel's link list, but you can see them in the 3D view. And they can't be found when creating the joint... So there's some bug somewhere there.

In any case, I'm not sure if connecting an IMU to an actor would give you the results you expect. The actor's links are animated, not simulated, so their velocities and accelerations are zero. I haven't checked the IMU code, but if it counts on these, then it may not work.

Asked by chapulina on 2018-12-09 11:34:20 UTC

Comments

Thank you for the answer. Yes, that's true that actor's links are animated, but I did some debugging and extracted separate joints' Pose and Twist messages to rViz. It seems that an orientation is changing while an actor is moving. That's the thing I want to get from IMU. Another idea is just to process the extracted info and create sensor_msgs::IMU messages out of it. Of course attaching an IMU is a much more elegant option. I edited the question, posted output from Gazebo.

Asked by rayvburn on 2018-12-09 13:33:36 UTC