Skip to content

Commit 3313a80

Browse files
committedJun 3, 2024
added task and setup files
0 parents  commit 3313a80

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed
 

‎ProgrammingTask.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Task 1
2+
Create a simple program in ROS do perform the desired maneuver as described below:
3+
1. Spawn a Turtle and draw a circle with it.
4+
2. when the first circle is drawn, the program must stop the first turtle, and call a service to spawn another turtle where the first turtle stopped.
5+
3. The second turtle should draw another circle larger than the initial circle, and stop when the circle is drawn
6+
### Task 2
7+
##### Objectives:
8+
1. Create a program to detect a coloured ball from camera input and track its movements.
9+
2. Publish its coordinates with respect to the screen and with respect to the camera's coordinate frame onto different topics
10+
for the coordinates with respect to the camera's coordinate frame, three dimensional coordinates are required.
11+
3. Create a different node that subscribes to the first topic , and moves a turtle in turtlesim such that it mimics the movements of the ball (if the ball is moved to the right, the turtle moves to the right as well.)

‎ros2setup.md

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
2+
# Software Installation
3+
4+
## OS and ROS versions
5+
Ubuntu 22.04
6+
ROS2 Humble
7+
8+
## Ubuntu 22.04 Installation guide
9+
10+
[Installation Guide](https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview)
11+
12+
## Ros2 humble Installation guide
13+
14+
### 1. Set locale:
15+
Make sure you have a locale which supports “UTF-8”. For this try the following commands.
16+
17+
```bash
18+
locale # check for UTF-8
19+
20+
sudo apt update && sudo apt install locales
21+
sudo locale-gen en_US en_US.UTF-8
22+
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
23+
export LANG=en_US.UTF-8
24+
25+
locale # verify settings
26+
```
27+
28+
### 2. Setup Sources:
29+
You will need to add the ROS 2 apt repository to your system.
30+
31+
First ensure that the Ubuntu Universe repository is enabled
32+
33+
```bash
34+
sudo apt install software-properties-common
35+
sudo add-apt-repository universe
36+
37+
```
38+
Now add the ROS 2 GPG key with apt.
39+
40+
```bash
41+
sudo apt update && sudo apt install curl -y
42+
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
43+
44+
```
45+
Then add the repository to your sources list.
46+
47+
```bash
48+
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" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
49+
50+
```
51+
### 3.Install Ros2 packages
52+
Update your apt repository caches after setting up the repositories.
53+
54+
```bash
55+
sudo apt update
56+
```
57+
ROS 2 packages are built on frequently updated Ubuntu systems. It is always recommended that you ensure your system is up to date before installing new packages.
58+
59+
```bash
60+
sudo apt upgrade
61+
```
62+
Desktop Install
63+
```bash
64+
sudo apt install ros-humble-desktop
65+
```
66+
### 4. Environment Setup:
67+
Set up your environment by sourcing the following file.
68+
```bash
69+
source /opt/ros/humble/setup.bash
70+
```
71+
Automatically add ROS environment variables to your bash session every time a new shell terminal/bash is launched, enter the following command.
72+
```bash
73+
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
74+
```
75+
Sourcing bashrc ensures to use updated bashrc using the following command, or it can be done by closing all terminals and re-opening a new terminal.
76+
```bash
77+
source ~/.bashrc
78+
```
79+
## Installation check
80+
81+
In one terminal, source the setup file and then run a C++ talker:
82+
```bash
83+
ros2 run demo_nodes_cpp talker
84+
```
85+
86+
In another terminal source the setup file and then run a Python listener:
87+
```bash
88+
ros2 run demo_nodes_py listener
89+
```
90+
You should see the talker saying that it’s publishing messages and the listener saying I heard those messages. This verifies both the C++ and Python APIs are working properly.
91+
92+
93+
```
94+
95+

‎task1video.mp4

329 KB
Binary file not shown.

0 commit comments

Comments
 (0)