From 428516503d3bb3fdd42b4373bf749aceec26b6c2 Mon Sep 17 00:00:00 2001 From: Sergi Hernandez Juan <shernand@iri.upc.edu> Date: Wed, 1 Apr 2020 17:14:40 +0200 Subject: [PATCH] Added a test launch file and a configuration for for the HC-SR04 sonar sensor in simulation. --- config/hc_sr04_sonar_ranger1d_sim_config.yaml | 10 ++++++ launch/hc_sr04_sonar_sim.launch | 32 +++++++++++++++++++ launch/lidar_lite_sim.launch | 2 +- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 config/hc_sr04_sonar_ranger1d_sim_config.yaml create mode 100644 launch/hc_sr04_sonar_sim.launch diff --git a/config/hc_sr04_sonar_ranger1d_sim_config.yaml b/config/hc_sr04_sonar_ranger1d_sim_config.yaml new file mode 100644 index 0000000..e955d01 --- /dev/null +++ b/config/hc_sr04_sonar_ranger1d_sim_config.yaml @@ -0,0 +1,10 @@ +rate: 20.0 +visualize: true +fov: 0.5 +min_range: 0.2 +max_range: 4.0 +resolution: 0.003 +frame_id: '/hcsr04_sonar/hcsr04_sonar_ranger1d' +ranger1d_topic: 'hcsr04_sonar_range' +type: 'ultrasound' +noise: 0.01 diff --git a/launch/hc_sr04_sonar_sim.launch b/launch/hc_sr04_sonar_sim.launch new file mode 100644 index 0000000..948ba41 --- /dev/null +++ b/launch/hc_sr04_sonar_sim.launch @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<launch> + + <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched --> + <include file="$(find gazebo_ros)/launch/empty_world.launch"> + <arg name="paused" value="false"/> + <arg name="use_sim_time" value="true"/> + <arg name="extra_gazebo_args" value=""/> + <arg name="gui" value="true"/> + <arg name="recording" value="false"/> + <arg name="headless" value="false"/> + <arg name="debug" value="false"/> + <arg name="physics" value="ode"/> + <arg name="verbose" value="false"/> + <arg name="world_name" value="worlds/empty.world"/> + <arg name="respawn_gazebo" value="false"/> + <arg name="use_clock_frequency" value="false"/> + <arg name="pub_clock_frequency" value="100"/> + </include> + + <param name="robot_description" + command="$(find xacro)/xacro --inorder '$(find iri_hcsr04_sonar_description)/urdf/hc_sr04_sonar_example.xacro'" /> + + <node pkg="robot_state_publisher" type="state_publisher" name="hcsr04_sonar_tf_broadcaster"> + <param name="tf_prefix" type="string" value="/hcsr04_sonar"/> + <param name="publish_frequency" type="double" value="20.0"/> + </node> + + <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model hcsr04_sonar_ranger1d -x 0 -y 0 -z 0 -R 0 -P 0 -Y 0" /> + +</launch> + diff --git a/launch/lidar_lite_sim.launch b/launch/lidar_lite_sim.launch index 02f4fbb..bb29526 100644 --- a/launch/lidar_lite_sim.launch +++ b/launch/lidar_lite_sim.launch @@ -26,7 +26,7 @@ <param name="publish_frequency" type="double" value="20.0"/> </node> - <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model lidar_lite_ranger1d_imu -x 0 -y 0 -z 0 -R 0 -P 0 -Y 0" /> + <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model lidar_lite_ranger1d -x 0 -y 0 -z 0 -R 0 -P 0 -Y 0" /> </launch> -- GitLab