You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for pointing out the issue. The newcoords method in CascadedCoords is set to change position relative to the parent link by default. To change coordinates relative to the world instead of the parent, you can do as follows. However, as you mentioned, this behavior might be confusing. As a solution, it might be better to add arguments like "world" or "local" to newcoords, similar to other functions, to allow changing coordinates relative to these. What do you think?
import numpy as np
from skrobot.coordinates import CascadedCoords, Coordinates
np.random.seed(0)
co1 = CascadedCoords(pos=[0.1, 0.2, 0.3])
co2 = CascadedCoords()
co1.assoc(co2)
new = Coordinates(pos=[1, 2, 3])
co2.newcoords(co2.parent.copy_worldcoords().inverse_transformation().transform(
new))
# co2.newcoords(new)
print(new)
print(co2)
I expected new and co2's worldcoords match, but they don't.
output
Looks like a bug, but I'm not certain.
Is changing the child coords allowed? If so, the above behavior is itended?
The text was updated successfully, but these errors were encountered: