Closed marcos-pereira closed 3 years ago
Thanks, @marcos-pereira,
Let me know how it goes.
Hi @mmmarinho , now when running
import numpy as np
from dqrobotics.robot_modeling import DQ_DifferentialDriveRobot
q = np.array([0.12, 0.0, 0.0])
diff_robot = DQ_DifferentialDriveRobot(1,1)
J = diff_robot.pose_jacobian(q)
print(J)
it throws a segmentation fault on the pose_jacobian line. Looking at the DQ_DifferentialDriveRobot.cpp I don't know exactly what is the problem. Maybe on line 52 when adding +1, but I'm not sure. Just a guess: the Matlab version returns a two column Jacobian matrix, hence, the J.block() on line 52 should be (0,0,3,2), in other words, there is no need for the +1. However I can't confirm that only by looking at the DQ_DifferentialDriveRobot.m and I also don't know how the Eigen block() method works.
Hello, @marcos-pereira !
Thanks for testing.
This robot is a bit different from the other ones so I need to fix the implementation. I’ll propose another fix tomorrow when I have access to my computer.
Cheers, Murilo
Hello, @marcos-pereira,
Could you check if it is working now? Thanks in advance.
Hi, @mmmarinho ,
Thanks for the fix, but it is still not working. When running:
import numpy as np
from dqrobotics.robot_modeling import DQ_DifferentialDriveRobot
q = np.array([0.12, 0.0, 0.0])
diff_robot = DQ_DifferentialDriveRobot(1,1)
J = diff_robot.pose_jacobian(q)
It strangely throws the runtime error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: DQ_DifferentialDriveRobot::pose_jacobian(q,to_link) only accepts to_link in {0,1}
I checked the DQ_DifferentialDriveRobot.cpp. It seems to be correct, but somehow it always enters the if
of line 50. I also tried calculating pose_jacobian(q,1)
or with different to_link
values, but the runtime error always happens.
Hello, @marcos-pereira,
Thanks for all helping me test this. The reason for this bug is quite convoluted so I won't explain in detail but I probably got it all fixed in 67398f0.
Please test it again and let me know if it doesn't work well.
Hi, @mmmarinho ,
Now the Jacobian is being correctly calculated. Many thanks for fixing this issue! However, I found another issue that is probably related to this one. I believe the issue is the same. I will open another issue since it is related to another code.
Best regards, Marcos
Hi @mmmarinho , although this issue is similar to issue #20 , I decided to open it because it is related to another file.
Bug description
To Reproduce
Code
Output
Expected behavior
Matlab code
Matlab output
Environment:
Additional context