Skip to content

Instantly share code, notes, and snippets.

@gcantoni
Created October 5, 2022 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gcantoni/393d19d81226c148deea268a0902515c to your computer and use it in GitHub Desktop.
Save gcantoni/393d19d81226c148deea268a0902515c to your computer and use it in GitHub Desktop.
1) Collegarsi alla pagina del tutorial:
http://wiki.ros.org/ROS/Tutorials
2) Aprire un terminale di comando (icona nera nella barra verticale a sinistra)
Di seguito questo terminale verrà chiamato T1
I comandi indicati di seguito con il simbolo T1 $ vanno copiati ed eseguiti nel terminale T1
3) Inizializzazione dell'ambiente ROS
T1 $ cd ROS
T1 $ cd devel
T1 $ . setup.bash
4) Tutorial 3 : Creating a ROS Package
Seguire le indicazioni della pagina
http://wiki.ros.org/ROS/Tutorials/CreatingPackage
Nel tutorial è indicata la cartella cd catkin_ws/
che corrisponde alla cartella ROS presente su questo computer
T1 $ cd ~/ROS/src
T1 $ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp
T1 $ cd ~/ROS/
T1 $ catkin_make
Nella cartella ROS/src/ è stata creata la sottocartella beginner_tutorials
che contiene due file e due sottocartelle
5) Tutorial 5 : Understanding ROS Nodes
Aprire un nuovo terminale di comando che chiamiamo T0
T0 $ roscore
T1 $ rosrun turtlesim turtlesim_node
6) Tutorial 6: Understanding ROS Topics
Aprire un nuovo terminale di comando che chiamiamo T2
T2 $ rosrun turtlesim turtle_teleop_key
Aprire un nuovo terminale di comando che chiamiamo T3
T3 $ rosrun rqt_graph rqt_graph
Viene visualizzato un grafo con due nodi e un arco che rappresenta i messaggi scambiati
Treminare i processi nei vari terminali con Ctrl-C
7) Tutorial 11: Writing a Simple Publisher and Subscriber (C++)
Al punto 1.1 The Code si dice di creare la cartella src. Non serve, è già stata creata.
Usando il browser scaricare i seguenti file nella cartella /ROS/src/beginner_tutorials/src/
https://raw.githubusercontent.com/ros/ros_tutorials/kinetic-devel/roscpp_tutorials/talker/talker.cpp
https://raw.githubusercontent.com/ros/ros_tutorials/kinetic-devel/roscpp_tutorials/listener/listener.cpp
Usando il browser scaricare il seguente file nella cartella /ROS/src/beginner_tutorials/
https://raw.githubusercontent.com/ros/catkin_tutorials/master/create_package_pubsub/catkin_ws/src/beginner_tutorials/CMakeLists.txt
Aprire il file CMakeLists.txt presente nella cartella beginner_tutorials con un editor di testo
e commentare le righe 9 e 10
## add_message_files(FILES Num.msg)
## add_service_files(FILES AddTwoInts.srv)
Eseguire i seguenti comandi
T1 $ cd ~/ROS
T1 $ catkin_make
7) Tutorial 13: Examining the Simple Publisher and Subscriber
T0 $ roscore
T1 $ cd ROS
T1 $ cd devel
T1 $ . setup.bash
T1 $ rosrun beginner_tutorials talker
T2 $ cd ROS
T2 $ cd devel
T2 $ . setup.bash
T2 $ rosrun beginner_tutorials listener
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment