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

feat: extract and publish realsense Sensor data #654

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

hemanth-vs
Copy link

PR Checklist

  • [ x] Added label to the Pull Request for easier discoverability and search
  • [x ] Commit Message meets guidelines as indicated in the URL https://github.com/intel-retail/automated-self-checkout/blob/main/CONTRIBUTING.md
  • [ x] Every commit is a single defect fix and does not mix feature addition or changes
  • [ x] Unit Tests have been added for new changes
  • [x ] Updated Documentation as relevant to the changes
  • [ x] All commented code has been removed
  • [x ] If you've added a dependency, you've ensured license is compatible with repository license and clearly outlined the added dependency.
  • PR change contains code related to security
  • PR introduces changes that breaks compatibility with other modules (If YES, please provide details below)

What are you changing?

We worked on a feature that extracts height, weight and depth data from RealSense Sensor. It publishes the data to Kafka, Grafana, Microservice. The data can be extracted using 'push' of the publishers as mentioned in the main file 'pollRealSenseSensor.py'.

Issue this PR will close

close: #538

Anything the reviewer should know when reviewing this PR?

We utilized Docker image. All the requirements and information pertaining to this issue and docker are mentioned in the RealSenseReadme.md.

Test Instructions if applicable

All the required instructions are outlined in the RealSenseReadme.md which is present in the sub directory '/src/RealSenseExtractor'.

If the there are associated PRs in other repositories, please link them here (i.e. intel-retail/automated-self-checkout )

@hemanth-vs hemanth-vs marked this pull request as draft January 28, 2025 05:26
@hemanth-vs hemanth-vs marked this pull request as ready for review January 28, 2025 05:27
@sakethr16
Copy link

We developed a Feature to address the intermediate issue #538.

PS :- Mentioning it here since we unable to tag the labels.

Copy link
Contributor

@NeethuES-intel NeethuES-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sakethr16 @hemanth-vs @Hemanth-byte I left comments in the code.
One comment on the PR title, can you change it to follow the git conventional commit format -
https://github.com/intel-retail/automated-self-checkout/blob/main/CONTRIBUTING.md

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

type here should be feat, instead of issue #538

src/RealSenseExtractor/GraphanaPublisher.py Outdated Show resolved Hide resolved
src/RealSenseExtractor/KafkaCore.py Show resolved Hide resolved
src/RealSenseExtractor/KafkaPublisher.py Show resolved Hide resolved
src/RealSenseExtractor/README.md Show resolved Hide resolved
src/RealSenseExtractor/Publisher.py Show resolved Hide resolved
src/RealSenseExtractor/UnitTests/GraphanaPublisherTest.py Outdated Show resolved Hide resolved
src/RealSenseExtractor/pollRealSenseSensor.py Show resolved Hide resolved
Data is being extracted from RealSensor and is getting published to Multiple SOurces such as Kafka, grafana or other microServices
dquote>
dquote> Data is being extracted from RealSensor and is getting published to Multiple SOurces such as Kafka, grafana or other microServices
dquote>
dquote>
dquote>
@sakethr16
Copy link

@NeethuES-intel We are not able to modify the PR Title, do you want us to raise another fresh PR?

@NeethuES-intel NeethuES-intel changed the title Issue #538: Real Sense Sensor data extraction and publishing feat: extract and publish realsense Sensor data Jan 30, 2025
@NeethuES-intel
Copy link
Contributor

@NeethuES-intel We are not able to modify the PR Title, do you want us to raise another fresh PR?

@sakethr16 ok, done.

## How to Run

### 1. Build the Docker Image
```bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you create a Makefile under src/RealSenseExtractor and add these as simple make commands eg -

automated-self-checkout/Makefile

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a Makefile.

## Configuration

Before running the service, ensure that the appropriate values are set in the `RealSenseConfig.json` file. This configuration file defines the necessary details for:
- RealSense camera settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can I run your code without a realsense camera ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No @NeethuES-intel , We cant run with realsense camera

FROM python:3.9-slim

# Set environment variables to ensure Python runs in non-buffered and UTF-8 mode
ENV PYTHONDONTWRITEBYTECODE 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the docker file.

from datetime import datetime
import json

class GraphanaPublisher(Publisher):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the spelling of Grafana in the file names, files, etc where applicable.

Suggested change
class GraphanaPublisher(Publisher):
class GrafanaPublisher(Publisher):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the file names.

@@ -0,0 +1,20 @@
{
"Graphana" : {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you configure this to use a local instance of grafana/influxdb - can set everything up in a docker compose file?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-02-02 at 7 55 15 PM Screenshot 2025-02-02 at 7 55 20 PM

We configured it to the user local instance of grafana and influx.

Copy link
Contributor

@NeethuES-intel NeethuES-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sakethr16 @Hemanth-byte @hemanth-vs I don't have a realsense camera to test. However I tried to run unit tests with make test but getting error. Not seeing the dashboard on grafana after running make up and I don't see any data coming through the grafana topics when I subscribe using an mqtt client.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Intermediate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build a microservice to extract height, width, depth information from a RealSense sensor
6 participants