Oct-20-2020, 01:42 AM
Hi all, I am new to Python programming and I being tasked to create codes by my supervisor but I have no clue how to.
I am doing a project on robots for my internship and he asked me to implement flags for different kind of 'modes' on the robot. He told me to add the flags in front line 5 so that the 'modes' can be easily detected. Modes being like 'Manual Driving'.
1. def callback(self, vel):
2. x = format(vel.linear.x, '+.2f')
3 z = format(vel.angular.z, '+.2f')
4. ##############################
5. pck = b':' + x + b',' + z
6. rospy.loginfo("Data Transmitting %s", pck)
7 # Check the number of bytes to fit the format
8 # b':+X.XX,+X.XX' => 12bytes ;)
This is what I am given. Any help would be greatly appreciated! :)
I am doing a project on robots for my internship and he asked me to implement flags for different kind of 'modes' on the robot. He told me to add the flags in front line 5 so that the 'modes' can be easily detected. Modes being like 'Manual Driving'.
1. def callback(self, vel):
2. x = format(vel.linear.x, '+.2f')
3 z = format(vel.angular.z, '+.2f')
4. ##############################
5. pck = b':' + x + b',' + z
6. rospy.loginfo("Data Transmitting %s", pck)
7 # Check the number of bytes to fit the format
8 # b':+X.XX,+X.XX' => 12bytes ;)
This is what I am given. Any help would be greatly appreciated! :)