Python Forum
Help in using Flag pretty please - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Help in using Flag pretty please (/thread-30404.html)



Help in using Flag pretty please - kamui123 - Oct-20-2020

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! :)


RE: Help in using Flag pretty please - Larz60+ - Oct-20-2020

Can't give proper answer without knowing more about the robot, and it's command set.