<s> import rospy <EOL> import std_msgs . msg <EOL> from youbot_modbus_server . srv import * <EOL> def poll_modbus_sensor_client ( ) : <EOL> print "<STR_LIT>" <EOL> rospy . wait_for_service ( '<STR_LIT>' ) <EOL> print "<STR_LIT>" <EOL> try : <EOL> modbus_handler = rospy . ServiceProxy ( '<STR_LIT>' , YoubotModbusSensorMsg ) <EOL> header = std_msgs . msg . Header ( ) <EOL> header . stamp = rospy . Time . now ( ) <EOL> header . frame_id = "<STR_LIT>" <EOL> print "<STR_LIT>" + str ( header ) <EOL> return modbus_handler ( header ) <EOL> except rospy . ServiceException , e : <EOL> print "<STR_LIT>" + str ( e ) <EOL> def poll_modbus_button_client ( ) : <EOL> rospy . wait_for_service ( '<STR_LIT>' ) <EOL> try : <EOL> modbus_handler = rospy . ServiceProxy ( '<STR_LIT>' , YoubotModbusButtonMsg ) <EOL> header = std_msgs . msg . Header ( ) <EOL> header . stamp = rospy . Time . now ( ) <EOL> header . frame_id = "<STR_LIT>" <EOL> print "<STR_LIT>" + str ( header ) <EOL> return modbus_handler ( header ) <EOL> except rospy . ServiceException , e : <EOL> print "<STR_LIT>" + str ( e ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> rospy . init_node ( '<STR_LIT>' ) <EOL> print "<STR_LIT>" + str ( poll_modbus_sensor_client ( ) ) <EOL> print "<STR_LIT>" + str ( poll_modbus_button_client ( ) ) </s>
