To pass more arguments to your callback function in rospy, it is actually super simple.
def callback(data, args):
arg1 = args
arg2 = args
sub = rospy.Subscriber("topic_name", String, callback, (arg1, arg2))
Of course, rather than a tuple, something like a single “String” could also be passed directly.