The launch file must ideally run the simulator alongwith the required nodes in the whycon package to detect markers in the image published by the overhead camera in Gazebo and should output a window of detected WhyCon markers [closed]
The launch file must ideally run the simulator alongwith the required nodes in the whycon package to detect markers in the image published by the overhead camera in Gazebo and should output a window of detected WhyCon markers
#!/usr/bin/env python
import rospy
import roslib
import tf
from geometry_msgs.msg import PoseArray
#Defining a class
class Marker_detect():
def __init__(self):
rospy.init_node('marker_detection',anonymous=False) # initializing a ros node with name marker_detection
self.whycon_marker = {} # Declaring dictionaries
rospy.Subscriber('/whycon/poses',PoseArray,self.whycon_data) # Subscribing to topic
# Callback for /whycon/poses
# Please fill in the function
def whycon_data(self,msg):
# Printing the detected markers on terminal
print(self.whycon_marker)
if __name__=="__main__":
marker = Marker_detect()
while not rospy.is_shutdown():
rospy.spin()
Closed for the following reason
Question does not follow our guidelines for questions. Please see: http://wiki.ros.org/Support for more details. by
mgruhler
close date 2019-11-04 01:29:04.847607
add a comment