bug:factorGraph object function addFactor returns less one than normal return value

조회 수: 1 (최근 30일)
this is minor bug, addFactor should return 1-based positive integer node index value,but in matlab R2022b return 0-base index value.
f = factorTwoPoseSE3([1 2])
f =
factorTwoPoseSE3 with properties: NodeID: [1 2] Measurement: [0 0 0 1 0 0 0] Information: [6×6 double]
g = factorGraph;
nodeId = addFactor(g,f)
nodeId = 0

채택된 답변

cui,xingxing
cui,xingxing 2023년 1월 7일
편집: cui,xingxing 2023년 1월 7일
The factorGraph series of functions was introduced in the recent R2022a release. Many of the descriptions of this series of functions are not stable and reliable, and addFactor returns factorID, which is based on a 0-base index, making it counter-intuitive.
Personally, to avoid unexpected results, I recommend using the poseGraph family of functions to solve your problem until Mathworks has officially updated the factorGraph description. As of now the affected versions are R2022a,R2022b.
references Issues:
  1. bug: factorGraph does not work for relative measurement angles
  2. factorGraph:Unclear document function factorTwoPoseSE3/SE2 with input parameter 'Measurement'

추가 답변 (1개)

Zheng Dong
Zheng Dong 2023년 1월 5일
편집: Zheng Dong 2023년 1월 6일
Hi Cui,
Referring to the doc page for addFactor, the return value of addFactor is factorID not nodeID, and factorID will start from 0. I am sorry for the confusion here.
Thanks,
Zheng
  댓글 수: 3
Zheng Dong
Zheng Dong 2023년 1월 6일
Hi Cui,
Please check my updated answer.
Thanks
Zheng
cui,xingxing
cui,xingxing 2023년 1월 7일
편집: cui,xingxing 2023년 1월 7일
Thanks for the update to clarify, but I personally still think it's weird that factorID is 0-based. I see a lot of official examples where factorID and nodeID are mixed together and don't overlap and affect each other, which confuses me!
I'm tempted to abandon it in favour of the original poseGraph until the official factorGraph update is available, as it's much more understandable and accessible. I hope TMW will take care of the new functions introduced!@Zheng Dong

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Localization Algorithms에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by