Skip to content

mohamedelmesawy/ROS-Study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published