-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crated node to subscribe to the the avlar markers and the publish the…
… ar tag id number and the position on anther node
- Loading branch information
Showing
5 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
uint32 id | ||
geometry_msgs/Pose pose | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule ar_track_alvar
deleted from
9c8fa0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python | ||
import rospy | ||
from std_msgs.msg import String | ||
from ar_track_alvar_msgs.msg import AlvarMarkers,AlvarMarker | ||
from ar_tag_demo.msg import ar_tag | ||
import rospy | ||
import sys | ||
import numpy as np | ||
|
||
from geometry_msgs.msg import Twist | ||
|
||
|
||
class ar_transform: | ||
|
||
def __init__(self): | ||
self.pub=rospy.Publisher("ar_pose_id", ar_tag) | ||
self.sub=rospy.Subscriber("ar_pose_marker", AlvarMarkers,self.callback) | ||
|
||
|
||
def callback(self,data): | ||
tagnumber=len(data.markers) | ||
for i in range(tagnumber): | ||
|
||
ar=ar_tag() | ||
ar.id=data.markers[i].id | ||
ar.pose=data.markers[i].pose.pose | ||
print ar | ||
|
||
self.pub.publish(ar) | ||
|
||
|
||
|
||
def main(args): | ||
rospy.init_node('ar_info', anonymous=True) | ||
ic= ar_transform() | ||
try: | ||
rospy.spin() | ||
except KeyboardInterrupt: | ||
print("Shutting down") | ||
cv2.destroyAllWindows() | ||
|
||
|
||
if __name__ == '__main__': | ||
main(sys.argv) | ||
|
||
|