-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
is there a way to use tensor cast for functions that return tuples? e.g.,
function axis_to_random_rotation3(x::AbstractVector)
x′ = similar(x)
x′ .= rand(eltype(x),3)
y = cross(x,x′)
z = cross(x,y)
R = [x y z]
R .= R./norm.(eachcol(R))'
return R
end
renorm!(n) = n ./= norm(n)
@views function plane_to_random_pose(Π)
renorm!(Π)
R = axis_to_random_rotation3(Π[1:3])
t = -Π[4].*Π[1:3]
return R, t
end
Here I want to use tensor cast to shape the returned pose from a set of planes e.g.
Π = rand(4,100)
@cast something something := plane_to_random_pose(Π[:,j])[i]
Metadata
Metadata
Assignees
Labels
No labels