Comments (9)
You can add a bumber plugin to the robot urdf, see here.
from hector_quadrotor.
Hello Martin. Thank you. I will add this bumper plugin to the robot urdf.
Normally, to add a sensor to a robot model, all we need to do is to add this plugin to the robot's main urdf file? In this case, on Hector Quadrotor Demo, there are plenty of urdf files. Which one is the main urdf file that I need to change?
quadrotor_sensors.gazebo.xacro on https://github.com/tu-darmstadt-ros-pkg/hector_quadrotor/blob/kinetic-devel/hector_quadrotor_gazebo/urdf/quadrotor_sensors.gazebo.xacro
or some other file?
And there is also the case that as far as I understand, we need to add the new plugin to the xacro file and then it is converted to urdf. Do we need any additional files to add like a cpp file for the sensor?
from hector_quadrotor.
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
100.0 base_link $(arg base_link_frame) raw_imu 0 0 0 0 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>
from hector_quadrotor.
After changing the quadrotor_base.urdf.xacro file, I converted it into quadrotor_base.urdf then tried to change into quadrotor_base.sdf file but it says permission denied. Is the quadrotor_base.sdf file protected? How can we add sensors to the quadrotor model?
I would be glad if I can add a contact sensor to detect collision. It will be very helpful for my maser thesis in machine learning.
Best regards
from hector_quadrotor.
You do not have to convert the xacro to urdf or sdf, the xacro is converted during execution. You can add the sensor to any xacro, that is loaded. The one you chose should be fine. I can not give you any advice on the bumper plugin, because I have never used it.
If the question is not directly related to hector_quadrotor, you can ask it at ROS Answers.
from hector_quadrotor.
So adding the necessary sensor to the quadrotor_base.urdf.xacro file should do the work, I won't need to do anything else. Then I will be able to see the sensor on rostopic list right?
I asked the question here because I was not sure which xacro file to add the sensor as it is related with the general structure of the project, you say quadrotor_base.urdf.xacro file would be fine. Let me try and tell the result.
Thank you again
from hector_quadrotor.
Here is the quadrotor_base.urdf.xacro file. I added the sensor plugin at two places just to be sure
<xacro:include filename="$(find hector_sensors_description)/urdf/sonar_sensor.urdf.xacro" />
<xacro:property name="pi" value="3.1415926535897931" />
<xacro:macro name="quadrotor_base_macro">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://hector_quadrotor_description/meshes/quadrotor/quadrotor_base.dae"/>
</geometry>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://hector_quadrotor_description/meshes/quadrotor/quadrotor_base.stl"/>
</geometry>
</collision>
<gazebo>
<plugin name="${name}_gazebo_ros_bumper_controller" filename="libgazebo_ros_bumper.so">
<alwaysOn>true</alwaysOn>
<updateRate>${update_rate}</updateRate>
<bumperTopicName>${name}_bumper</bumperTopicName>
<frameName>world</frameName>
</plugin>
</gazebo>
</link>
<!-- Sonar height sensor -->
<xacro:sonar_sensor name="sonar" parent="base_link" ros_topic="sonar_height" update_rate="10" min_range="0.03" max_range="3.0" field_of_view="${40*pi/180}" ray_count="3">
<origin xyz="-0.16 0.0 -0.012" rpy="0 ${90*pi/180} 0"/>
</xacro:sonar_sensor>
<gazebo>
<plugin name="${name}_gazebo_ros_bumper_controller" filename="libgazebo_ros_bumper.so">
<alwaysOn>true</alwaysOn>
<updateRate>${update_rate}</updateRate>
<bumperTopicName>${name}_bumper</bumperTopicName>
<frameName>world</frameName>
</plugin>
</gazebo>
</xacro:macro>
After that I saved the project and run with roslaunch hector_quadrotor_demo indoor_slam_gazebo.launch command. There was no difference with the sensor list. I closed the project and typed
catkin_make
source devel/setup.bash
Then I re run the project. The final list of the sensors are as follows
user:~$ rostopic list
/aerodynamics/wrench
/altimeter
/clock
/cmd_vel
/command/motor
/command/twist
/command/wrench
/fix
/fix_velocity
/front_cam/camera/camera_info
/front_cam/camera/image
/front_cam/camera/image/compressed
/front_cam/camera/image/compressed/parameter_descriptions
/front_cam/camera/image/compressed/parameter_updates
/front_cam/camera/image/compressedDepth
/front_cam/camera/image/compressedDepth/parameter_descriptions
/front_cam/camera/image/compressedDepth/parameter_updates
/front_cam/camera/image/theora
/front_cam/camera/image/theora/parameter_descriptions
/front_cam/camera/image/theora/parameter_updates
/front_cam/parameter_descriptions
/front_cam/parameter_updates
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/ground_truth/state
/ground_truth_to_tf/euler
/ground_truth_to_tf/pose
/joint_states
/magnetic
/motor_pwm
/motor_status
/pressure_height
/propulsion/wrench
/quadro/trigger
/raw_imu
/rosout
/rosout_agg
/scan
/sonar_height
/supply
/tf
/tf_static
/wind
Again the contact sensor was not there. Can it be because I am working on the constructsim environment or something else?
from hector_quadrotor.
Your issue is probably related to your usage of the bumper plugin. You might want to look into, if you are using it correctly. However, I can not help you any further in this regard.
from hector_quadrotor.
Alright Martin. Vielen dank! :)
from hector_quadrotor.
Related Issues (20)
- In docker run Demo is Segmentation fault (core dumped)
- Issue when cmake-ing hector-quadrotor in ros kinetic
- PX4 with hector_quadrotor
- allow the drone to fly along the prescribed route
- How to realize the flight of the drone along a fixed trajectory
- problem with enable_motors service in kinetic HOT 1
- how to model motor voltages on the quadrotor
- Gazebo process died (terminate called after throwing an instance of 'boost::exception_detail::clone_impl...) HOT 4
- Turning on motors in hector quadrotor demo HOT 9
- Flying by points upside down
- Is hector_quadrotor available on ROS 2 Foxy?
- Two quadrotors getting spawned in two different frames tree having two different world frames
- [ERROR] Controller Spawner couldn't find the expected controller_manager ROS interface.
- Is hector_quadrotor available on ros noetic & Gazebo 11? HOT 1
- hector_quadrotor not hovering while using teleop_twist_keyboard
- Running different SLAM packages like OpenKarto, Gmapping, Kimera on hector quadrotor
- How to use hector_quadrotor_gazebo_plugins
- catkin_make error! HOT 2
- in docker run the demo , roslaunch hector_quadrotor_demo outdoor_flight_gazebo.launch is error Aborted (core dumped) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hector_quadrotor.