Skip to content

Commit

Permalink
[install-dependencies] Better handle ROS2
Browse files Browse the repository at this point in the history
  • Loading branch information
gergondet committed Oct 12, 2023
1 parent bf9d43b commit a3583a0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions install-dependencies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ async function use_ros_workspace(setup)
for(let V of vars.split('\n'))
{
let [name, value] = V.split('=');
if(name && name.startsWith('ROS'))
if(name && (name.startsWith('ROS') || name.startsWith('AMENT')))
{
core.exportVariable(name, value);
}
Expand Down Expand Up @@ -334,12 +334,22 @@ async function handle_ros(ros)
core.endGroup();
}
core.startGroup('Install ROS base packages');
await exec.exec(`sudo apt-get install -y ros-${ros_distro}-ros-base python3-catkin-tools python3-rosdep python3-wstool`);
core.endGroup();
core.startGroup('Initialize rosdep');
await exec.exec('sudo rosdep init');
await exec.exec('rosdep update --include-eol-distros');
if(!is_ros2)
{
await exec.exec(`sudo apt-get install -y ros-${ros_distro}-ros-base python3-catkin-tools python3-rosdep python3-wstool`);
}
else
{
await exec.exec(`sudo apt-get install -y ros-${ros_distro}-ros-base python3-colcon-common-extensions`);
}
core.endGroup();
if(!is_ros2)
{
core.startGroup('Initialize rosdep');
await exec.exec('sudo rosdep init');
await exec.exec('rosdep update --include-eol-distros');
core.endGroup();
}
core.startGroup('Setup ROS env');
await use_ros_workspace(`/opt/ros/${ros_distro}/setup.bash`);
core.endGroup();
Expand Down

0 comments on commit a3583a0

Please sign in to comment.