User Tools

Site Tools


neurali:husky_esempi_messaggi_con_rostopic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

neurali:husky_esempi_messaggi_con_rostopic [2016/07/12 17:24] – created profproneurali:husky_esempi_messaggi_con_rostopic [2020/06/08 22:20] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Esempi di messaggi con Husky ======
 +
 +===== Ricevere un messaggio =====
 +
 +
 +[[neurali:husky]]
 +
 +Qui viene applicato quanto spiegato in [[neurali:ros_nodes]]
 +
 +Qui c'è l'elenco dei topic [[neurali:husky topic]]. Prendiamo ad esempio 
 +
 +  /clock
 +
 +Visualizzabile (è pubblicato) con
 +
 +  rostopic echo /clock
 +
 +Due comandi sul tipo di dato e sulla descrizione/dettagli
 +
 +  rostopic type /clock
 +  rosmsg show rosgraph_msgs/Clock
 +
 +Due risposte
 +
 +  rosgraph_msgs/Clock
 +  time clock
 +
 +Combinandoli insieme si ottiene lo stesso risultato
 +
 +  rostopic type /clock | rosmsg show
 +  
 +  
 +  
 +----
 +===== Pubblicare un messaggio =====
 +
 +
 +  /cmd_vel
 +
 +Tipo di dato
 +
 +  rostopic type /cmd_vel
 +
 +  geometry_msgs/Twist
 +
 +  rostopic type /cmd_vel | rosmsg show
 +<code>
 +geometry_msgs/Vector3 linear
 +  float64 x
 +  float64 y
 +  float64 z
 +geometry_msgs/Vector3 angular
 +  float64 x
 +  float64 y
 +  float64 z
 +</code>
 +
 +Invio singolo (è stato sottoscritto)
 +
 +  rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[1.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'
 +
 +Invio a frequenza di 1 Hz
 +
 +  rostopic pub /cmd_vel geometry_msgs/Twist -r 1 -- '[1.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'
 +
 +----
 +
 +
 +  
 +  
 +  
 +  
 +
  
neurali/husky_esempi_messaggi_con_rostopic.txt · Last modified: 2020/06/08 22:20 by 127.0.0.1