Repository navigation
add vel and torque to lerobot conversion - #76
Conversation
kou
left a comment
There was a problem hiding this comment.
Claude Code says the following. What do you think about it?
Is it intentional that observation.velocity and observation.torque are smoothed in the same way as observation.state?
Currently qvel and qtorque go through the existing smoothing path:
to_lerobotv21()/to_lerobotv30()calldataset.set_smoothing(cutoff=smoothing_cutoff)(default: 1.0 Hz)Dataset._load_embodiment_values()applies_apply_smoothing()to every loaded attribute, includingqvel/qtorque_apply_smoothing()is a 4th order Butterworth low-pass filter withfiltfilt
A 1 Hz low-pass filter may be acceptable for positions, but I think it's too strong for torque and velocity. For example, short torque spikes from contacts or collisions are mostly removed. This doesn't match the motivation of this PR: "keeping the data complete for future use".
How about one of the following?
- Don't smooth
qvel/qtorque(just resample them to the target FPS) - Use a separate cutoff for them (e.g.
--arm-dynamics-smoothing-cutoff)
If smoothing them with the same cutoff is intentional, could you explain the reason and document it in the README?
| return arms | ||
|
|
||
|
|
||
| def _collect_downsampled_data( |
There was a problem hiding this comment.
It seems that we can remove this function.
| "lerobot_v2.1 or lerobot_v3.0 (default: exported when every episode " | ||
| "recorded them)", | ||
| action="store_true", | ||
| default=None, |
There was a problem hiding this comment.
Could you remove default=None because this is a boolean option? (default=False is the default)
| default=None, |
|
This is also one thing that I'm not sure of. I see that previously we don't really turn off smoothing when the value is set to 0. I think it would be better if we keep a version that simply convert the data as it is because once I have them visualized, i see quite a difference between the completely raw one vs a slightly smoothed one. I suggest to set 1 hz manually when there's a need for smoothing the dataset. |
|
OK. Let's change the BTW, Claude Code's question was a different one: should |
|
Typically if a model is training on a 1hz dataset, the model usually don't use torque and velocity. Adding a smaller cutoff is doable for the torque and velocity data, but I don't think that would help the model too much to know what's actually happening here, since the gap for videos and actions are too long when smoothing it to 1hz. I would suggest to put the 0 feature in this pr, since they're actually related to each other. What do you think? |
|
I'm also changing the --no-arm-dynamics to --arm-dynamics so it doesn't keep these information by default. |
|
Just to confirm: For the |
|
sure makes sense! thank you! |
|
How about #77 ? |
|
Thanks for the pr! It looks good! |
|
Merged! Could you rebase on main? |
|
Can I push some minor cleanups such as #76 (comment) and #76 (comment) to this branch before we merge this? |
|
i did those changes in my branch so no worries |
|
Thanks! Merged! |
previous implementation missed the vel and torque information in each record, this pr add these into the flow, keeping the data complete for future use.