ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Adding collision sensor on Hector Quadrotor Demo

asked 2020-04-22 16:43:25 -0500

jean01 gravatar image

updated 2020-04-23 11:58:53 -0500

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

http://wiki.ros.org/hector_quadrotor/...

using the links

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

and

https://answers.gazebosim.org//questi...

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

edit retag flag offensive close merge delete

Comments

Lets say we have this

<gazebo reference="${lr}_arm_fist"> <sensor name="lowerleg_contactsensor_sensor" type="contact"> <always_on>true</always_on> <contact> <collision>${lr}_upper_arm_fixed_joint_lump__${lr}_bump_sensor_collision_collision_1</collision> </contact> <plugin name="${lr}_arm_fist_plugin" filename="libgazebo_ros_bumper.so"> <bumpertopicname>${lr}_arm_fist_contact</bumpertopicname> <framename>${lr}_arm_fist</framename> </plugin> </sensor> </gazebo>

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

jean01 gravatar image jean01  ( 2020-04-23 11:38:16 -0500 )edit

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

jean01 gravatar image jean01  ( 2020-04-24 07:13:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-04-24 07:12:35 -0500

jean01 gravatar image

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

<robot <a="" href="http://xmlns:xacro="http://ros.org/wiki/xacro%22">xmlns:xacro="http://ros.org/wiki/xacro"></robot>

<gazebo> <plugin name="quadrotor_imu_sim" filename="libhector_gazebo_ros_imu.so"> <updaterate>100.0</updaterate> <bodyname>base_link</bodyname> <frameid>$(arg base_link_frame)</frameid> <topicname>raw_imu</topicname> <rpyoffsets>0 0 0</rpyoffsets> <gaussiannoise>0</gaussiannoise> <acceldrift>0.5 0.5 0.5</acceldrift> <accelgaussiannoise>0.35 0.35 0.3</accelgaussiannoise> <ratedrift>0.1 0.1 0.1</ratedrift> <rategaussiannoise>0.05 0.05 0.015</rategaussiannoise> </plugin>

<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>

</sensor>

</gazebo> </robot>

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-04-22 16:43:25 -0500

Seen: 438 times

Last updated: Apr 24 '20