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 个评论
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

请先登录,再进行评论。

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by