Skip to content

Commit 33dedf3

Browse files
committed
feat: revert to ros2 and instal move it but not compile it (yet)
1 parent 48dc7bd commit 33dedf3

File tree

5 files changed

+73
-19
lines changed

5 files changed

+73
-19
lines changed

.devcontainer/Dockerfile

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,45 @@
11
FROM lcas.lincoln.ac.uk/lcas/devcontainer/ros2-teaching:2324-devel
22

3-
# Install OS Packages etc
4-
RUN sudo apt-get update && sudo apt-get install -y \
5-
git \
6-
curl \
7-
wget
3+
COPY .devcontainer/run.sh /root/
4+
RUN chown root:root /root/run.sh
5+
RUN chmod +x /root/run.sh
6+
RUN bash -c "/root/run.sh"
7+
8+
RUN su lcas
9+
RUN sudo chown -R lcas /opt/ros/lcas/
10+
RUN sudo chmod 777 /opt/ros/lcas/install/setup.bash
11+
RUN cat /opt/ros/lcas/install/setup.bash
812

9-
RUN sudo apt install python3-rosdep
13+
RUN bash -c 'source /opt/ros/lcas/install/setup.bash'
1014

11-
RUN sudo rosdep init -y
12-
RUN rosdep update -y
13-
RUN sudo apt update -y
15+
# RUN bash -c 'ros2 topic list'
1416

15-
RUN mkdir -p /workspaces/CMP9764/ws_moveit2/
16-
RUN cd /workspaces/CMP9764/ws_moveit2/
17+
RUN sudo mkdir -p /ws_moveit2/src
18+
COPY ./src /ws_moveit2/src
19+
RUN sudo chown -R lcas /ws_moveit2/
20+
RUN sudo chmod -R 777 /ws_moveit2/
1721

18-
RUN git clone --branch humble https://github.com/ros-planning/moveit2_tutorials
22+
RUN git clone --branch humble https://github.com/ros-planning/moveit2_tutorials /ws_moveit2/src/moveit2_tutorials/
23+
24+
# Install OS Packages etc
25+
RUN sudo apt-get update && sudo apt-get install -y \
26+
git \
27+
curl \
28+
wget \
29+
python3-rosdep \
30+
python3-vcstool \
31+
python3-colcon-common-extensions \
32+
python3-colcon-mixin \
33+
ros-humble-ament-cmake-python
1934

20-
RUN sudo apt update -y && rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y
35+
RUN bash -c 'rosdep update -y'
36+
RUN bash -c 'sudo apt update -y'
37+
RUN bash -c 'cd /ws_moveit2'
2138

22-
RUN colcon build --parallel-workers 1
39+
RUN bash -c 'vcs import < /ws_moveit2/src/moveit2_tutorials/moveit2_tutorials.repos'
2340

24-
RUN echo 'source /workspaces/CMP9764/ws_moveit2/install/setup.bash' >> ~/.bashrc
41+
RUN bash -c 'rosdep install -r --from-paths /ws_moveit2/src/moveit2_tutorials --ignore-src --rosdistro $ROS_DISTRO -y'
42+
# RUN bash -c 'colcon build --parallel-workers 1'
2543

2644
# add commit history to bust cache if and when needed.
2745
ADD "https://api.github.com/repos/LCAS/cmp9764/commits?per_page=1&sha=main" .lcas_addons.commits

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"name": "lcas-ros2-cmp9764",
55
"build": {
66
// Uncomment block for local devcontainer building
7+
"context": "..",
78
"dockerfile": "Dockerfile"
89
},
910
//"image": "lcas.lincoln.ac.uk/lcas/devcontainer/ros_cmp9764:humble",
@@ -26,7 +27,7 @@
2627
// Use 'postCreateCommand' to run commands after the container is created.
2728
// "postCreateCommand": "bash .devcontainer/run.sh",
2829
"containerUser": "lcas",
29-
"workspaceFolder": "/home/lcas/ws",
30+
// "workspaceFolder": "/home/lcas/ws",
3031
// Configure tool-specific properties.
3132
// "customizations": {},
3233
"runArgs": ["--security-opt", "seccomp=unconfined", "--cap-add=NET_ADMIN"],

.devcontainer/run.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
add_source_bashrc () {
4+
if ! grep -q "source $1" ~/.bashrc; then
5+
echo "source $1" >> ~/.bashrc
6+
fi
7+
}
8+
9+
set -e
10+
11+
export WORKSPACE="`pwd`"
12+
sudo chown -R lcas /home/lcas/ws || true
13+
sudo chown -R lcas /workspaces || true
14+
15+
source /opt/ros/lcas/install/setup.bash
16+
sudo apt update
17+
rosdep --rosdistro=humble update
18+
19+
20+
# sudo rm -rf /opt/ros/lcas
21+
# sudo mkdir -p /opt/ros/lcas/src
22+
# sudo chown -R lcas /opt/ros/lcas
23+
# cd /opt/ros/lcas/src
24+
# vcs import < $WORKSPACE/.devcontainer/lcas.repos
25+
# rosdep install --from-paths . -i -y
26+
# cd /opt/ros/lcas
27+
# colcon build
28+
29+
30+
cd /home/lcas/ws
31+
colcon build
32+
add_source_bashrc "/opt/ros/lcas/install/setup.bash"
33+
add_source_bashrc "/home/lcas/ws/install/setup.bash"
34+
source /home/lcas/ws/install/setup.bash
35+
File renamed without changes.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# CMP9764 - Advanced Robotics, ROS Noetic Devcontainer
2-
A template repository for teaching robotics with ROS Noetic.
1+
# CMP9764 - Advanced Robotics
2+
A template repository for teaching robotics with ROS2 (Humble) and Moveit2
33

4-
This repository is based on the [ros2-teaching-ws](https://github.com/lcas/ros2-teaching-ws) and has been downgraded to support ROS Noetic.
4+
This repository is based on the [ros2-teaching-ws](https://github.com/lcas/ros2-teaching-ws).
55

66
## Use case
77

0 commit comments

Comments
 (0)