Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added first Report #95

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
71 changes: 71 additions & 0 deletions docs/computer/student_Reports/Shubh_ROS_Report_2021.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: ROS Report for Internship at AUVZHCET
author: Shubh Singhal
email: [email protected]
Duration: 1 July - 7 August 2021
---

## ROS (Robot Operating System)

**Objective**: Complete ROS revision, Creating a basic talker & listener node

**Resources**:
- [ROS tutorials](http://wiki.ros.org/ROS/Tutorials)
- [_towardsdatascience_ Blog](https://towardsdatascience.com/what-why-and-how-of-ros-b2f5ea8be0f3)
- [ Overview Video on ROS](https://www.youtube.com/watch?v=vrFFnupcRL4)

**Tech/Software used**: Ubuntu 20.04/ ROS Noetic

**Summary**:
ROS or Robot Operating System is a middleware, more of a low-level framework responsible for handling the communication between programs in a distributed system. The idea behind using ROS is creation of unique sub-programs (_nodes_) for each particular task. There are various parts of ROS such as topics, messages, nodes, services etc. In Robotics one has to deal with plenty of senosrs & actuators. Instead of creating a single large code-base to run the entire robot, ROS helps us in creating a distributed system for all these components.

| ![ROS Workflow](static/Shubh_2021_1.jpeg) |
| :---: |
| Fig: Workflow of ROS |

**Procedure**:
A basic talker and listener node will be created. The talker node is responsible for detecting the keyboard input
```
#!/usr/bin/env python3 #The first line makes sure your script is executed as a Python script.
import rospy
from std_msgs.msg import String #String message type will be used for publishing

import getch

def talker():
pub = rospy.Publisher('which_key', String, queue_size=10) #talker publishes to the topic which_key
rospy.init_node('key_publisher', anonymous=True) #Tells rospy the name of our node
rate = rospy.Rate(10)
while not rospy.is_shutdown():
key = getch.getch()
pub.publish(key)

rate.sleep()

if __name__ == '__main__':
try:
talker()
except rospy.ROSInterruptException:
pass
```
The subscriber node will do as its name suggests. It subcribes to our topic `which_key` and logs the message.

```
#!/usr/bin/env python3
import rospy
from std_msgs.msg import String

def callback(data):
rospy.loginfo("I heard %s", data)

def listener():
rospy.init_node('key_subscriber', anonymous=True)
rospy.Subscriber('which_key', String, callback)
rospy.spin()

if __name__ == '__main__':
listener()
```
**Result**: Completed an overview of ROS from various resources. Created a talker/listener setup which detects `keyboard` inputs

**Future Work**: Shift current code to ROS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/computer/student_Reports/students.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Format: [Designation - Team - Name - Academic Year] (Link to the doc)
- [Acoustic Source Localization Subsystem - SAUVC - Mohd Hozaifa Khan - 2019-20](Acoustic-Source_Mohd-Hozaifa-Khan.md)
- [COVID-19 Precautionary System for ZHCET - SAUVC - Mohd Hozaifa Khan - 2019-20](Computer-Team_SAUVC_Mohd-Hozaifa-Khan_2019-20.md)
- [Vorc Competition](vorc.md)
- [Intern-Computer Team-Shubh-ROS-2021](Shubh_ROS_Report_2021.md)