Open marcos-pereira opened 3 years ago
Hello, @marcos-pereira,
As you know, the DQ_DifferentialDriveRobot
has a constraint in the pose_jacobian()
that makes most of the controller code in CPP incompatible with it. Have you tried it in MATLAB? Could you make a minimal working example and let me know?
If it also doesn't work in MATLAB, we'll need to think of a fix for all the languages in a future version of the library and that will take longer.
Cheers, Murilo
Hi @mmmarinho ,
Thanks for the note. I tried the same code on MATLAB Code
q = [0.12 0 0];
robot = DQ_DifferentialDriveRobot(1,1);
J_pose = robot.pose_jacobian(q);
solver = DQ_QuadprogSolver;
controller = DQ_ClassicQPController(robot,solver);
gain_controller_eta = 10;
controller.set_gain(gain_controller_eta);
controller.set_damping(0.001);
controller.set_control_objective(ControlObjective.Pose);
x = 1;
y = 1;
phi = 0;
qd = [x, y, phi];
task_reference = robot.fkm(qd);
u_qdot = controller.compute_setpoint_control_signal(q,vec8(task_reference))
Output
Matrix dimensions must agree.
Error in DQ_ClassicQPController/compute_objective_function_symmetric_matrix (line
44)
H = J'*J +
controller.damping*eye(controller.robot.get_dim_configuration_space());
Error in DQ_TaskspaceQuadraticProgrammingController/compute_setpoint_control_signal
(line 73)
H = controller.compute_objective_function_symmetric_matrix(J,
task_error);
Error in issue_holonomic_base_jacobian (line 26)
u_qdot = controller.compute_setpoint_control_signal(q,vec8(task_reference))
Since J is a 8x2 matrix, J'*J results in a 2x2 matrix. The damping factor generated is being generated with an identity matrix 3x3 because the dimension of the configuration space is 3. However, I am not sure if only using an identity matrix 2x2 will fix the problem because of the dimensions of the other matrices in the optimization problem.
While the DQ_DifferentialDriveRobot is not working with the QP controller, I will try to use the DQ_HolonomicBase robot model in my application. I have already adapted the holonomic_base_control.m to use the QP controller in MATLAB. I will adapt it to Python.
In the case of further testing with the DQ_DifferentialDriveRobot, just let me know.
Hello, @marcos-pereira,
Thank you for the report. As I expected, the controller code does not currently behave well for DQ_DifferentialDriveRobot
in any language.
Please let me discuss this internally with @bvadorno and we'll work on a comprehensive fix for a future release.
Your approach seems good for the time being.
Thanks again for your time.
Cheers, Murilo
Hi @marcos-pereira,
A good way to go in this case is to use the DQ_HolonomicBase
and then use an equality constraint to enforce the nonholonomic constraint, similarly to what we did in Quiroz-Omaña, Juan José, and Bruno Vilhena Adorno. 2018. “Whole-Body Kinematic Control of Nonholonomic Mobile Manipulators Using Linear Programming.” Journal of Intelligent & Robotic Systems 91 (2): 263–78. https://doi.org/10.1007/s10846-017-0713-4.
Best regards, Bruno
Hello @bvadorno ,
Thanks for the idea. I will check on that.
Best regards, Marcos
Bug description
To Reproduce
Code
Output
Expected behavior
Environment:
Additional context