Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/core/lambkin-shepherd/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,21 @@ def dump_ros_2_parameters(
"""
ros2cli = import_module('ros2cli.node.strategy')
ros2param = import_module('ros2param.api')
if not hasattr(ros2param, "PARAMETER_SEPARATOR_STRING"):
rclpy_param = import_module('rclpy.parameter')
ros2param.PARAMETER_SEPARATOR_STRING = rclpy_param.PARAMETER_SEPARATOR_STRING
with ros2cli.NodeStrategy(Namespace(**kwargs)) as node:
output = deepdict()
for node_name in list_nodes_with_parameters(node=node):
parameter_names = (
ros2param.call_list_parameters(
node=node, node_name=node_name))
future = ros2param.call_list_parameters(
node=node, node_name=node_name)
list_parameters_result = future.result()
if list_parameters_result is None:
raise RuntimeError(
f"Error in lambkin.shepherd.robot.api.ros2.dump_ros_2_parameters: "
f"Failed to list parameters for node '{node_name}'."
)
parameter_names = list_parameters_result.result.names
parameter_values = get_node_parameters(
node=node, node_name=node_name,
parameter_names=parameter_names)
Expand Down Expand Up @@ -123,6 +132,9 @@ def set_ros_2_parameter(
ros2param = import_module('ros2param.api')
rcl_interfaces = import_module('rcl_interfaces.msg')
parameter = rcl_interfaces.Parameter(name=name)
if not hasattr(ros2param, "get_parameter_value"):
rclpy_param = import_module('rclpy.parameter')
ros2param.get_parameter_value = rclpy_param.get_parameter_value
parameter.value = ros2param.get_parameter_value(string_value=str(value))
with ros2cli.NodeStrategy(Namespace(**kwargs)) as node:
known_node_names = list_nodes_with_parameters(node=node)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Start Recording ROS 2 Bag
[Documentation] Starts recording a ROS 2 bag in the background.
[Arguments] ${bag} ${cwd}=. &{kwargs}
[Tags] imperative
${options} = Convert To Command Line Options output=${bag} &{kwargs}
${options} = Convert To Command Line Options output=${bag} storage=sqlite3 &{kwargs}
${process} = Start Managed Process ros2 bag record @{options} alias=RECORD:${bag} cwd=${cwd}
Process Should Be Running RECORD:${bag} msg=${bag} recording process is not running
RETURN ${process}
Expand Down
2 changes: 1 addition & 1 deletion src/core/lambkin-shepherd/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ envlist =
poetry_check

[testenv]
allowlist_externals = poetry
allowlist_externals = poetry,flake8,robocop,mypy,pytest,robot
commands_pre =
poetry install --with dev --no-root --sync
passenv = # ROS specific
Expand Down
6 changes: 6 additions & 0 deletions src/external/os/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ ADDUSER:
ARG uid
ARG gid
ARG workdir=/home/${user}
IF getent passwd ${uid} > /dev/null
RUN deluser --remove-home $(id -nu ${uid})
END
IF getent group ${gid} > /dev/null
RUN delgroup $(getent group ${gid})
END
RUN addgroup --gid ${gid} ${user} && \
adduser --uid ${uid} --ingroup ${user} \
--home /home/${user} --shell /bin/bash ${user} && \
Expand Down
9 changes: 6 additions & 3 deletions src/external/ros2/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ embed-ubuntu-release:
ARG rosdistro
FROM os+ubuntu --distro=${distro}
COPY rosdistro.yml /etc/.
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
LET ros_apt_source_version = $(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F 'tag_name' | awk -F\\\" '{print $4}')
RUN curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ros_apt_source_version}/ros2-apt-source_${ros_apt_source_version}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb"
RUN dpkg -i /tmp/ros2-apt-source.deb
LET rosdistro = "${rosdistro}"
IF [ "$rosdistro" = "" ]
SET rosdistro = "$(yq .ubuntu.${distro} /etc/rosdistro.yml || echo unknown)"
Expand All @@ -35,6 +36,8 @@ embed-ubuntu-devel:
ARG distro
ARG rosdistro # forward
FROM +embed-ubuntu-release --distro=${distro} --rosdistro=${rosdistro}
RUN pip install colcon-common-extensions poetry colcon-poetry-ros==0.8.0
RUN apt update && apt install -y python3-venv && apt clean && rm -rf /var/lib/apt/lists/*
RUN pip install pipx colcon-common-extensions colcon-poetry-ros==0.8.0
RUN pipx install --global poetry
## NOTE(hidmic): remove colcon-poetry-ros weird script relocation
RUN sed -i '111,131d' $(python3 -c "import colcon_poetry_ros.task.poetry.build as m; print(m.__file__)")