Skip to content

Commit

Permalink
feat: add sensorkit swtching (#57)
Browse files Browse the repository at this point in the history
* feat: add sensor kit change for simulation

* chore: add ignore and pre-commit fix

* chore: aichallenge/workspace/.gitignore

Co-authored-by: Takagi, Isamu <43976882+isamu-takagi@users.noreply.github.com>

* fix: add simulation arg

---------

Co-authored-by: Takagi, Isamu <43976882+isamu-takagi@users.noreply.github.com>
  • Loading branch information
taikitanaka3 and isamu-takagi authored Sep 4, 2024
1 parent 8a870bb commit 5118ae5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
<arg name="use_sim_time" default="true"/>
<arg name="launch_vehicle_interface" default="false"/>
<arg name="sensor_model" default="racing_kart_sensor_kit"/>
<arg name="simulation" default="true"/>
<log message="echo launch param use_sim_time: $(var use_sim_time) launch_vehicle_interface: $(var launch_vehicle_interface) sensor_model: $(var sensor_model)"/>

<include file="$(find-pkg-share aichallenge_submit_launch)/launch/reference.launch.xml" >
<arg name="vehicle_model" value="racing_kart"/>
<arg name="sensor_model" value="$(var sensor_model)"/>
<arg name="map_path" value="$(find-pkg-share aichallenge_submit_launch)/map"/>
<arg name="use_sim_time" value="$(var use_sim_time)"/>
<arg name="simulation" value="$(var simulation)"/>
<arg name="launch_vehicle_interface" value="$(var launch_vehicle_interface)"/>
</include>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<arg name="map_path" default="/aichallenge/mapfile"/>
<arg name="vehicle_model" default="racing_kart" description="vehicle model name"/>
<arg name="sensor_model" description="sensor model name"/>
<arg name="simulation" description="used for sensor kit param"/>

<!-- Optional parameters -->
<!-- Map -->
Expand All @@ -29,7 +30,7 @@
<arg name="model_file" default="$(find-pkg-share tier4_vehicle_launch)/urdf/vehicle.xacro" description="path to the file of model settings (*.xacro)"/>
<arg name="config_dir" default="$(find-pkg-share racing_kart_sensor_kit_description)/config"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" exec="robot_state_publisher">
<param name="robot_description" value="$(command 'xacro $(var model_file) vehicle_model:=$(var vehicle_model) sensor_model:=$(var sensor_model) config_dir:=$(var config_dir)' 'warn')"/>
<param name="robot_description" value="$(command 'xacro $(var model_file) vehicle_model:=$(var vehicle_model) sensor_model:=$(var sensor_model) config_dir:=$(var config_dir) simulation:=$(var simulation)' 'warn')"/>
</node>
</group>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sensor_kit_base_link:
gnss_link:
x: 0.0
y: 0.0
z: 0.0
roll: 0.0
pitch: 0.0
yaw: 0.0
imu_link:
x: 0.0
y: 0.0
z: 0.0
roll: 0.0
pitch: 0.0
yaw: 0.0
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
sensor_kit_base_link:
gnss_link:
x: 0.0
x: -0.26
y: 0.0
z: 0.0
roll: 0.0
pitch: 0.0
yaw: 0.0
imu_link:
x: 0.0
x: 0.85
y: 0.0
z: 0.0
roll: 0.0
pitch: 0.0
yaw: 0.0
yaw: -1.5707963268
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<xacro:arg name="gpu" default="false"/>
<xacro:arg name="config_dir" default="$(find racing_kart_sensor_kit_description)/config"/>
<xacro:arg name="simulation" default="false"/>

<xacro:property name="sensor_kit_base_link" default="sensor_kit_base_link"/>

Expand All @@ -18,8 +19,11 @@
</link>

<!-- sensor -->
<xacro:property name="calibration" value="${xacro.load_yaml('$(arg config_dir)/sensor_kit_calibration.yaml')}"/>

<xacro:property name="calibration" value="${xacro.load_yaml('$(arg config_dir)/sensor_kit_calibration.yaml')}"/>
<!-- over write calibration file for simulation -->
<xacro:if value="$(arg simulation)">
<xacro:property name="calibration" value="${xacro.load_yaml('$(arg config_dir)/awsim_sensor_kit_calibration.yaml')}"/>
</xacro:if>
<!-- gnss -->
<xacro:imu_macro
name="gnss"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<arg name="sensor_model" value="$(var sensor_model)"/>
<arg name="use_sim_time" value="$(var use_sim_time)"/>
<arg name="launch_vehicle_interface" value="$(var launch_vehicle_interface)"/>
<arg name="simulation" value="$(var simulation)"/>
</include>

<!-- Workaround because the simulator cannot use the service. -->
Expand Down

0 comments on commit 5118ae5

Please sign in to comment.