Gazebo | Ignition | Community
Ask Your Question
0

Attaching a sensor to a PARTICULAR LINK of an animated actor

asked 2018-12-08 17:50:10 -0500

rayvburn gravatar image

updated 2018-12-09 12:32:23 -0500

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 ...
(more)
edit retag flag offensive close merge delete

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`

chapulina gravatar imagechapulina ( 2018-12-10 11:19:39 -0500 )edit

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

rayvburn gravatar imagerayvburn ( 2018-12-10 16:16:05 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-12-09 10:34:20 -0500

chapulina gravatar image

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.

edit flag offensive delete link more

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.

rayvburn gravatar imagerayvburn ( 2018-12-09 12:33:36 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-12-08 17:50:10 -0500

Seen: 474 times

Last updated: Dec 09 '18