“Dimensions of arrays being concatenated are not consistent”
    1 visualización (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
I am getting said error even thoug I don't think I am not concatenating any array.
wallCordsReal = [];
    homoVecSen = [sonars(1); 0; 0; 1];
    poser = gtposes(1,:);
    transMatrix = Tsonar2univ(poser);
    tempWall = transMatrix * homoVecSen;

And here is the function Tsonar2univ:
    function transfMatrix = Tsonar2univ(poser)
    global measured_offsx;
    global measured_offsy;
    global measured_offsphi;
    %sonar origin relative to robot
    RorgS = [measured_offsx; measured_offsy; 0];
    UorgR = [poser(1); poser(2); 0];
    RrS = [cos(measured_offsphi), sin(measured_offsphi), 0; -sin(measured_offsphi), cos(measured_offsphi), 0; 0, 0, 1]
    UrR = [cos(poser(3)), -sin(poser(3)), 0; sin(poser(3)), cos(poser(3)), 0; 0, 0, 1];
    RtS = zeros(4,4);   
    RtS(1:3, 1:3) = RrS;
    RtS(1:3, 4) = RorgS;
    UtR = zeros(4,4);   
    UtR(1:3, 1:3) = UrR;
    UtR(1:3, 4) = UorgR;
    UtR(4,4) = 1;
    transfMatrix = UtR * RtS;
end
0 comentarios
Respuestas (1)
  James Tursa
      
      
 el 28 de Abr. de 2020
        TYpe this at the command line:
dbstop if error
then run your code. When the error occurs the code will pause with all current variables intact. Examine measured_offsphi and you will probably see it is not a scalar. Then backtrack in your code and figure out why.
6 comentarios
  James Tursa
      
      
 el 30 de Abr. de 2020
				Well, did you do what I suggested in my very first post?  That puts you in the debugger where you can figure things out.
Ver también
Categorías
				Más información sobre Robotics en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


