How to make a maker parallel to a vector [closed]
Hi there, I'm trying to define a marker(cylinder) which connects two known frames visualized in rviz. I want this maker point from one frame to the other frame...
And the what I've gotten now is the transform between these two known frames. The first thing I come up with is make this marker parallel to this transform vector. But I was failed to implement this idea.
I would be appreciated if you can give some Pseudo Code (and the function names that will be perfect). OR, maybe a greater idea to make this thing up.
Code_of_mine
marker.pose.position.x = ls_transform.getOrigin().x()/2;
marker.pose.position.y = ls_transform.getOrigin().y()/2;
marker.pose.position.z = ls_transform.getOrigin().z()/2;
marker.pose.orientation.x = ls_transform.getRotation().x();
marker.pose.orientation.y = ls_transform.getRotation().y();
marker.pose.orientation.z = ls_transform.getRotation().z();
marker.pose.orientation.w = ls_transform.getRotation().w();
And the marker is put in the middle of two frame, but the angle is not correct. (Sorry I can't load up my picture cause I don't got enough points...)
P.S. I set the marker_frame follow the one of two frames(which means origin = 0). When I set the marker_frame is my first frame, problem still occur.