Closed gitouni closed 1 year ago
I found the answer in https://carla.readthedocs.io/en/0.9.13/ref_sensors/#lidar-sensor. It said the rotation freqeuncy of lidar needs to match the simulation interval. Thus, a feasible solution to modify the rotation frequency is to set the fixed_delta_seconds
to 0.1 (equivalent to 10Hz).
The modified launch file is shown below:
<!-- -->
<launch>
<!-- CARLA connection -->
<arg name='host' default='localhost'/>
<arg name='port' default='2000'/>
<arg name='timeout' default='10'/>
<!-- Ego vehicle -->
<arg name='role_name' default='ego_vehicle'/>
<arg name="vehicle_filter" default='vehicle.*'/>
<arg name="spawn_point" default=""/><!-- use comma separated format "x,y,z,roll,pitch,yaw" -->
<!-- Map to load on startup (either a predefined CARLA town (e.g. 'Town01'), or a OpenDRIVE map file) -->
<arg name="town" default='Town02'/>
<!-- Enable/disable passive mode -->
<arg name='passive' default=''/>
<!-- Synchronous mode-->
<arg name='synchronous_mode_wait_for_vehicle_control_command' default='False'/>
<arg name='fixed_delta_seconds' default='0.1'/>
<include file="$(find carla_ros_bridge)/launch/carla_ros_bridge.launch">
<arg name='host' value='$(arg host)'/>
<arg name='port' value='$(arg port)'/>
<arg name='town' value='$(arg town)'/>
<arg name='timeout' value='$(arg timeout)'/>
<arg name='passive' value='$(arg passive)'/>
<arg name='synchronous_mode_wait_for_vehicle_control_command' value='$(arg synchronous_mode_wait_for_vehicle_control_command)'/>
<arg name='fixed_delta_seconds' value='$(arg fixed_delta_seconds)'/>
</include>
<!-- the ego vehicle, that will be controlled by an agent (e.g. carla_ad_agent) -->
<include file="$(find carla_spawn_objects)/launch/carla_example_ego_vehicle.launch">
<arg name="objects_definition_file" value='$(find carla_spawn_objects)/config/lidar_only.json'/>
<arg name='role_name' value='$(arg role_name)'/>
<arg name="spawn_point_ego_vehicle" value="$(arg spawn_point)"/>
<arg name="spawn_sensors_only" value="false"/>
</include>
<include file="$(find carla_manual_control)/launch/carla_manual_control.launch">
<arg name='role_name' value='$(arg role_name)'/>
</include>
</launch>
Dear developers: I don't know how to modify the
rotation frequency
of lidar in ros_bridge. The default frequency is 20, which is shonw in objects.json. I modified therotation frequency
and usedrosbag record
to record lidar topic. However, the recorded lidar point clouds flashed in therviz
, indicating the collected point cloud did not match the rotation frequency.I guess the modification of
rotation frequency
parameter will not modify the spinning speed of the Lidar, so it caused a asysnchronization between rotating and data receiving. My settings are shown below.Envrioment
Carla: 0.9.13 ROS: Noetic Sys: Ubuntu 20.04.5
Command
carla_with_sensors.launch
lidar_only.json