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

Getting joint_state nan in ros2 control #20

Closed
ErikParkerrr opened this issue Apr 29, 2024 · 4 comments
Closed

Getting joint_state nan in ros2 control #20

ErikParkerrr opened this issue Apr 29, 2024 · 4 comments

Comments

@ErikParkerrr
Copy link

ErikParkerrr commented Apr 29, 2024

Hi all,
I have two ODrives working perfectly with ros2 control thanks to this repo. I'm just using simple velocity controllers.

On the joint_states topic I get the joint states of my other ODrives perfectly, but the third one reports nan. I can control the third ODrive perfectly, so I don't think it can be an issue with how ros2 control is setup.

I've tried factory resetting, etc. The position reports correctly in the web GUI. Not sure how to diagnose this further, looking for suggestions.

Thank you.

@samuelsadok
Copy link
Member

Is the configuration on all three ODrives identical? In particular, maybe feedback messages weren't enabled on the third one?
If you have odrivetool installed, you can dump the config with odrivetool backup-config myconfig.json and compare them.

If that doesn't help, the next step I can think of would be to add log output to the ROS hardware interface on every incoming CAN message (lmk if more details needed).

@harborhoffer
Copy link

I have actually just run into the same problem where position for left/right botwheels are .nan.

header:
  stamp:
    sec: 1723225036
    nanosec: 880660577
  frame_id: ''
name:
- left_wheel_joint
- right_wheel_joint
position:
- .nan
- .nan
velocity:
- 0.0
- 0.0
effort:
- 0.0014819717034697533
- 0.0 

@samuelsadok Can you be a little more specific on "maybe feedback messages weren't enabled". What are feedback messages as they relate to the odrive config?

@ErikParkerrr
Copy link
Author

@harborhoffer, I solved this problem, but I completely forgot I had this ticket open. Believe it or not, on the third Odrive I accidentally wired the CAN_H to 12v (one pin off). It was enough to give the system hell, but it was robust enough to be still mostly operational. Double check your wiring. I couldn't believe it when I saw it.

With "feedback messages not enabled" I think they meant the option in the CAN configuration on the Odrive.

Cheers

@harborhoffer
Copy link

This turned out to be a misconfiguration of one of my odrives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants