Last active
December 29, 2021 05:34
-
-
Save Kanazawanaoaki/a4db07e5762ae597714e71799d03d363 to your computer and use it in GitHub Desktop.
pickle::dump_test
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
#!/usr/bin/env python | |
import rospy | |
from smach_msgs.msg import SmachContainerStatus | |
def callback(msg): | |
print (pickle.loads(msg.local_data)) | |
def listener(): | |
rospy.init_node('dump_listener', anonymous=True) | |
rospy.Subscriber('/smach/container_status', SmachContainerStatus, callback) | |
rospy.spin() | |
if __name__ == '__main__': | |
listener() |
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
(require :pickle "package://roseus_smach/src/pickle.l") | |
(ros::roseus-add-msgs "smach_msgs") | |
(ros::roseus "dump_publisher") | |
(ros::advertise "/smach/container_status" smach_msgs::SmachContainerStatus 100) | |
(defun test-msg () | |
(setq *msg* (instance smach_msgs::SmachContainerStatus :init)) | |
(send *msg* :local_data (pickle::dump '((:hoge ((1 2 3) (4 5 6)))))) | |
(ros::publish "/smach/container_status" *msg*) | |
) | |
(warn "please run (test-msg) ~%") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment