Code Monkey home page Code Monkey logo

ros-study's Introduction

ROS-Course

Create Custom ROS Package - Example_01

Create Custom ROS Package

Start ROSCORE

$ roscore

Create/Initialize Workspace

$ mkdir messi_ws
$ cd messi_ws
$ mkdir src
$ cd src/
$ catkin_init_workspace 

Build

$ cd ..
$ catkin_make
$ source ./devel/setup.bash 
$ cd src/
$ catkin_create_pkg messi_turtle_pkg rospy geometry_msgs 

Build

$ cd ..
$ catkin_make

Create scripts and the python file

$ cd messi_turtle_pkg/
$ mkdir scripts

$ cd scripts
$ touch move_turtelsim.py; chmod +x *

Run the turtlesim_node

$ rosrun turtlesim turtlesim_node  

Run our node messi_turtle_pkg

$ rosrun messi_turtle_pkg move_turtelsim.py 

Display the Graph nodes

$ rosrun rqt_graph rqt_graph 

Create Custom ROS Package - Example_02

Publisher and Subscriber

Run the publisher node

$ rosrun turtlesim publisher.py  

Run our subscriber node

$ rosrun messi_turtle_pkg subscriber.py 

Display the Graph nodes

$ rosrun rqt_graph rqt_graph 

Create Custom ROS Package - User Input - Example_03

input_user

Run the turtlesim_node

$ rosrun turtlesim turtlesim_node  

Run our node messi_turtle_pkg

$ rosrun messi_turtle_pkg input_user.py

Display the Graph nodes

$ rosrun rqt_graph rqt_graph 

Create publisher and subscriber to count from 0 until the user uses CTRL C - Example_04

publisher_counter

Run our node messi_turtle_pkg publisher_counter

$ rosrun messi_turtle_pkg  publisher_counter.py 

Run our node messi_turtle_pkg subscriber

$ rosrun messi_turtle_pkg subscriber.py

Display the Graph nodes

$ rosrun rqt_graph rqt_graph 

Create publisher and subscriber to generate a random complex number - Example_05

complex_number

Run our node messi_turtle_pkg publisher_complex_number

$ rosrun messi_turtle_pkg  publisher_complex_number.py

Run our node messi_turtle_pkg subscriber

$ rosrun messi_turtle_pkg subscriber.py

Display the Graph nodes

$ rosrun rqt_graph rqt_graph 

Create Custom Message - Example_06

Message

Run our node test_pkg mypublisher.py --> which exists in workspace other_ws

$ rosrun test_pkg mypublisher.py 

Run our node test_pkg mysubscriber.py --> which exists in workspace other_ws

$ rosrun test_pkg mysubscriber.py

Display the Graph nodes

$ rosrun rqt_graph rqt_graph 

Create Custom Service - Words Counter - Example_07

Service_words_counter

Run our node test_pkg count_words_server.py --> which exists in workspace other_ws

$ rosrun test_pkg count_words_server.py

Run our node test_pkg count_words_client.py --> which exists in workspace other_ws

$ rosrun test_pkg count_words_client.py <text>

Display the Graph nodes

$ rosrun rqt_graph rqt_graph 

Create Custom Service - Adding Two Numbers - Example_08

Service

Run our node test_pkg add_two_numbers_server.py --> which exists in workspace other_ws

$ rosrun test_pkg count_words_server.py

Run our node test_pkg add_two_numbers_server.py --> which exists in workspace other_ws

$ rosrun test_pkg add_two_numbers_client.py <num1> <num2>

Display the Graph nodes

$ rosrun rqt_graph rqt_graph 

Create ROSLaunch File - Example_09

image

image

image

Run our ROSLaunch_file in test_pkg --> which exists in workspace other_ws

$ roslaunch test_pkg world.launch

Display the Graph nodes

$ rosrun rqt_graph rqt_graph 

ros-study's People

Contributors

mohamedelmesawy 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.