Robotics StackExchange | Archived questions

Adding collision sensor on Hector Quadrotor Demo

Hello I am trying to add a collision sensor to Hector Quadrotor robot model on this simulation:

http://wiki.ros.org/hector_quadrotor/Tutorials/Quadrotor%20indoor%20SLAM%20demo

using the links

http://gazebosim.org/tutorials?tut=contact_sensor

and

https://answers.gazebosim.org//question/5355/adding-ros-integrated-contact-sensors/

Which way should I follow? As far as I understand, we should change some .xacro files but there are plenty of them in the Hector Quadrotor Demo folders and I am not sure which ones to change and how? This is an important part of my research and it needs to be done as soon as it can be. If you have any clue about how a bump contact sensor can be implemented on this demo project, I would be glad to listen. Thank you

Asked by jean01 on 2020-04-22 16:43:25 UTC

Comments

Lets say we have this

true ${lr}upper_arm_fixed_joint_lump_${lr}_bump_sensor_collision_collision_1 ${lr}_arm_fist_contact ${lr}_arm_fist

How am I going to modify it to be used in my quadrotor model and which file should I change?

Asked by jean01 on 2020-04-23 11:38:16 UTC

I changed the quadrotor_sensors.gazebo.xacro file and added the contact_bumper sensor as follows, saved the file, ran the simulation but could not see a new sensor added when I enter rostopic list

Asked by jean01 on 2020-04-24 07:13:34 UTC

Answers

I changed the quadrotor_sensors.gazebo.xacro file and added the contact_bumper sensor as follows, saved the file, ran the simulation but could not see a new sensor added when I enter rostopic list

<?xml version="1.0"?>

<!-- Quadrotor Sensor Plugins --> 100.0 base_link $(arg base_link_frame) raw_imu 0 0 0 <!-- deprecated --> 0 <!-- deprecated --> 0.5 0.5 0.5 0.35 0.35 0.3 0.1 0.1 0.1 0.05 0.05 0.015

<plugin name="quadrotor_baro_sim" filename="libhector_gazebo_ros_baro.so">
  <updateRate>10.0</updateRate>
  <bodyName>base_link</bodyName>
  <frameId>$(arg base_link_frame)</frameId>
  <topicName>pressure_height</topicName>
  <altimeterTopicName>altimeter</altimeterTopicName>
  <offset>0</offset>
  <drift>10.0</drift>
  <gaussianNoise>0.1</gaussianNoise>
</plugin>

<plugin name="quadrotor_gazebo_ros_bumper_controller" filename="libgazebo_ros_bumper.so">
  <updateRate>10.0</updateRate>
  <bodyName>base_link</bodyName>
  <frameId>$(arg base_link_frame)</frameId>
  <alwaysOn>true</alwaysOn>    
  <topicName>contact_bumper</topicName>
  <offset>0 0 0</offset>
  <drift>0.0 0.0 0.0</drift>
  <gaussianNoise>1.3e-2 1.3e-2 1.3e-2</gaussianNoise>
</plugin>

<plugin name="quadrotor_magnetic_sim" filename="libhector_gazebo_ros_magnetic.so">
  <updateRate>10.0</updateRate>
  <bodyName>base_link</bodyName>
  <frameId>$(arg base_link_frame)</frameId>
  <topicName>magnetic</topicName>
  <offset>0 0 0</offset>
  <drift>0.0 0.0 0.0</drift>
  <gaussianNoise>1.3e-2 1.3e-2 1.3e-2</gaussianNoise>
</plugin>

<plugin name="quadrotor_gps_sim" filename="libhector_gazebo_ros_gps.so">
  <updateRate>4.0</updateRate>
  <bodyName>base_link</bodyName>
  <frameId>$(arg base_link_frame)</frameId>
  <topicName>fix</topicName>
  <velocityTopicName>fix_velocity</velocityTopicName>
  <referenceLatitude>49.860246</referenceLatitude>
  <referenceLongitude>8.687077</referenceLongitude>
  <drift>5.0 5.0 5.0</drift>
  <gaussianNoise>0.01 0.01 0.01</gaussianNoise>
  <velocityDrift>0 0 0</velocityDrift>
  <velocityGaussianNoise>0.05 0.05 0.05</velocityGaussianNoise>
</plugin>

<plugin name="quadrotor_groundtruth_sim" filename="libgazebo_ros_p3d.so">
  <updateRate>100.0</updateRate>
  <bodyName>base_link</bodyName>
  <topicName>ground_truth/state</topicName>
  <gaussianNoise>0.0</gaussianNoise>
  <frameName>$(arg world_frame)</frameName>
</plugin>

<sensor name="gripper_contact_sensor" type="contact">
<always_on>true</always_on>
<update_rate>30.0</update_rate>
<contact>
  <collision>collision</collision>
</contact>
<plugin name="gripper_bumper" filename="libgazebo_ros_bumper.so">
  <bumperTopicName>gripper_contact_sensor_state</bumperTopicName>
  <frameName>gripper</frameName>
</plugin>

Asked by jean01 on 2020-04-24 07:12:35 UTC

Comments