Giter VIP home page Giter VIP logo

opt_industries's Introduction

OPT INDUSTRIES

Github Repo for coding challenge of OPT Industries

Authors

Installation

Clone this repository by using below command if you have GIT LFS installed.

   git clone https://github.com/krunalna/OPT_INDUSTRIES.git

If you don't have GIT LFS installed, you'll need to manually download the files.

1. Open https://github.com/krunalna/OPT_INDUSTRIES.git in any browser of your choice.
2. You'lll see a Green button named "Code". Click on it.
3. Click on Download Zip from there and the downloading should start.
4. Once Downloaded, follow the rest of the instructions.

Go to your the location and run the following command. Please Note: It is assumed that you have already installed docker and docker daemon running. If not please refer official documentation for installation and run the docker daemon.

    docker import krunal_code.tar <your_name>:latest
    docker images
    docker run -it <your_name>:latest bash

Replace <your_name> with any name variable name you want.

Open a new terminal to get the container_id. You'll need to get the container id of the docker image you just ran by using the following command.

    docker ps -a

Copy the container id.

Now, we are done with setting up the docker container. We can proceed with running our actual code.

Important point to remember: Each time you open a new terminal, you'll have to run the following command first. Lets call this command as MAIN command.

    docker exec -it <container_id> bash

Once you have executed the above command, you open a new terminal in the docker environment. You can verfiy this by checking the username in the terminal. It should be similar to root@<container_id>

Here comes the execution of the challenge.

In the first termianal, runn the MAIN command and then run the following command

    cd root && python3 server.py

This command will change the directory to root and run the server.py file. Server.py file is the Flask App incrementer file. You can keep this terminal open

Now, open a second terminal and execute the MAIN command first

    cd root/catkin_ws && source /opt/ros/noetic/setup.bash && source devel/setup.bash && roscore

This commands sources the ROS environments and starts the roscore. Keep this terminal open as well.

Lastly, Open a third terminal and execute the MAIN Command first.

    cd root/catkin_ws && source /opt/ros/noetic/setup.bash && source devel/setup.bash && rosrun OPT_INDUSTRIES talker.py

You should now see an incrementing integer displayed on the terminal. This incrementing integer is fetched from the Flask app that is running in the terminal 1.

References:

https://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29

https://www.digitalocean.com/community/tutorials/how-to-make-a-web-application-using-flask-in-python-3

opt_industries's People

Contributors

krunalna avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.