I am having trouble using the se3 transformation matrix function in MATLAB

Hello everyone, I was having issues using se3 example code in the documentation. The official documentation says this should work.
angles = [pi/2 0 pi/7];
trvec = [6 4 1];
TF = se3(angles,"eul","XYZ",trvec)
TF = se3
0.9010 -0.4339 0 6.0000 0.0000 0.0000 -1.0000 4.0000 0.4339 0.9010 0.0000 1.0000 0 0 0 1.0000
After I run it, I get an error saying:
Error using matlabshared.spatialmath.internal.SE3Base
Invalid number of arguments. To create an se3, specify 2 or fewer arguments.
Error in se3 (line 70)
obj@matlabshared.spatialmath.internal.SE3Base(varargin{:});
Error in testforspectrum (line 4)
TF = se3(angles,"eul","XYZ",trvec)
Anybody have any suggestions?
Thank you

Answers (1)

What version of MATLAB are you using? I edited your post so the code could be run here, and it works without error.
Note that se3 requires one of the following toolboxes to be installed:
  • Navigation Toolbox
  • Robotics System Toolbox
  • UAV Toolbox
If you have access to these toolboxes on your license, you can add them using the Add-Ons explorer

2 Comments

Hello Cris,
Thanks for the response. I am currently using MATLAB R2022b- academic use and I have all the toolboxes installed but still can't run it
Some changes to the methods and syntaxes were introduced in R2023a (see here)
In R2022b, you must use one of the following syntaxes:

Sign in to comment.

Products

Release

R2022b

Asked:

on 1 May 2023

Edited:

on 1 May 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!