Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: could not convert string to float #1

Open
ahmetanbar opened this issue Jul 20, 2019 · 2 comments
Open

ValueError: could not convert string to float #1

ahmetanbar opened this issue Jul 20, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@ahmetanbar
Copy link

ahmetanbar commented Jul 20, 2019

Hi,

When I run the command
python automailx.py --serial COM2
the program starts. But after about 20 seconds, I get the error

line 357, in __readserial
gz = float(gyro[3])
ValueError: could not convert string to float: b'10\xb552'

Firstly, it seem like correct, leg moves according to moving of mpu6050.
But after a while, the error occured.

I write here similar errors for different applications.

ValueError: could not convert string to float: b'2.\xb17'

ValueError: could not convert string to float: b'?086107.12'

ValueError: could not convert string to float: b'1059\xb767.37'

ValueError: could not convert string to float: b'\xf1034624.93'

ValueError: could not convert string to float: b'23.5\xb6'

I try it on two different mpu6050 sensor. Result is the same. Could it be related with wire connections?

I use python 3.x

I also want to learn that what we assume where the sensor? It is at heel or in the middle of the leg or knee cap? Also, shouldn't we use two sensors to to understand the position of the leg?

Thank you

@rodrigost23
Copy link
Owner

Ok, try to see in the serial monitor if the output from the Arduino is something like ypr -24.96 -15.83 -58.95 aworld 12608 -11447 30806 flex 108955.89 and if the baud rate is set to 115200.

Also, have you uploaded the code in the file automailx.ino?


I also want to learn that what we assume where the sensor? It is at heel or in the middle of the leg or knee cap? Also, shouldn't we use two sensors to to understand the position of the leg?

I positioned the MPU-6050 just above the knee and also have a flex sensor to understand the joint position, but I think it probably feasible to just change it to use another MPU-6050.

Position of the sensors

(In my tests, I used the flex sensor behind the knee due to it being too small)

@rodrigost23 rodrigost23 added the bug Something isn't working label Jul 22, 2019
@ahmetanbar
Copy link
Author

I try it on different arduino uno. It works clearly. Broken arduino works in serial monitor at arduino IDE. I don't know what is the problem. Some characters is broken like "-" -> "=" or numbers.

I don't know how importance, but there can be put try/catch. Nevertheless, it is python :)

Flex sensor is logical. I though on the way. I think some positions can't be understand in this way. For example, people could have extended its feet. In this station,flex sensor acts like when the people is in standing. Did I miss something? I see that we couldn't understand the position of leg.

Let's imagine that in the simulation, we have two MPU-6050 at ankle and at knee. If we make some calculations by comparing them, we get a relative result. So we can understand their position.

Flex sensor is really logical but I feel it is not enough. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants