Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

ros python subscriber

#!/usr/bin/env python
import rospy
from std_msgs.msg import String

def callback(data):
    rospy.loginfo(rospy.get_caller_id() + "I heard %s", data.data)
    
def listener():

    rospy.init_node('listener', anonymous=True)

    rospy.Subscriber("chatter", String, callback)

    rospy.spin()

if __name__ == '__main__':
    listener()
Comment

PREVIOUS NEXT
Code Example
Python :: Python Relative Strength Indicator 
Python :: numpy take out elements equal to zero 
Python :: urllib.error.HTTPError: HTTP Error 403: Forbidden 
Python :: entropy python 
Python :: python custom array sort 
Python :: how to convert a list into string with  
Python :: check cuda available tensorflow 
Python :: how to get the index of a value in pandas dataframe 
Python :: remove rows or columns with NaN value 
Python :: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaple 
Python :: Slicing lexicographically pandas 
Python :: Savefig cuts off title 
Python :: python split a string by tab 
Python :: pytest installation windows 
Python :: how to wait in pygame 
Python :: python get current time in hours minutes and seconds 
Python :: how to print not equal to in python 
Python :: python check if string is a float 
Python :: where to find python interpreter 
Python :: tkinter bold text 
Python :: intersection of dataframes based on column 
Python :: python list inversion 
Python :: save plot as image python matplotlib 
Python :: add button to streamlit 
Python :: py pause script 
Python :: django import settings variables 
Python :: python sum comprehension 
Python :: colored text python 
Python :: from .cv2 import * ImportError: /home/pi/.local/lib/python3.7/site-packages/cv2/cv2.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: __atomic_fetch_add_8 
Python :: add download directory selenium python 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =