Skip to content

Commit

Permalink
Move default firmware params to leo_fw
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsowa committed Nov 6, 2023
1 parent c564616 commit d6e1728
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
16 changes: 7 additions & 9 deletions leo_bringup/launch/leo_bringup.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
description="Flag specifying wheel types of the robot for visualization purposes" />
<arg name="tf_frame_prefix" default="" />

<arg name="override_param_file"
<arg name="firmware_params_file"
default=""
description="Absolute path to yaml file with firmware parameters to be overrided" />
description="Absolute path to the yaml file with firmware parameters to be overrided" />

<include file="$(find-pkg-share leo_description)/launch/state_publisher.launch.xml">
<arg name="model" value="$(var model)" />
<arg name="mecanum_wheels" value="$(var mecanum_wheels)"/>
<arg name="mecanum_wheels" value="$(var mecanum_wheels)" />
</include>

<node pkg="web_video_server"
Expand All @@ -39,6 +39,10 @@
<param from="$(find-pkg-share leo_bringup)/config/firmware_message_converter.yaml" />
</node>

<node pkg="leo_fw" exec="firmware_parameter_bridge">
<param name="override_params_file_path" value="$(var firmware_params_file)" />
</node>

<node_container namespace=""
name="image_container"
pkg="rclcpp_components"
Expand Down Expand Up @@ -77,10 +81,4 @@
<node pkg="leo_bringup"
exec="leo_system" />

<node pkg="leo_fw" exec="firmware_parameter_bridge">
<param name="default_params_file_path"
value="$(find-pkg-share leo_bringup)/config/firmware.yaml" />
<param name="override_params_file_path" value="$(var override_param_file)" />
</node>

</launch>
File renamed without changes.
12 changes: 11 additions & 1 deletion leo_fw/leo_fw/nodes/parameter_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from os import path
from typing import Optional

import yaml # type: ignore

from ament_index_python import get_package_share_directory

from rcl_interfaces.msg import Parameter as ParameterMsg, SetParametersResult
from rcl_interfaces.srv import SetParameters

Expand Down Expand Up @@ -54,7 +59,12 @@ def __init__(self, executor: MultiThreadedExecutor) -> None:
super().__init__("firmware_parameter_bridge")
self.executor = executor

self.declare_parameter("default_params_file_path", "")
leo_fw_share = get_package_share_directory("leo_fw")

self.declare_parameter(
"default_params_file_path",
path.join(leo_fw_share, "data", "default_firmware_params.yaml"),
)
self.declare_parameter("override_params_file_path", "")

self.default_param_file: str = (
Expand Down

0 comments on commit d6e1728

Please sign in to comment.