Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible issue with interactive marker control with local (moving) coordinate frame #935

Open
jjnak opened this issue Oct 21, 2015 · 4 comments

Comments

@jjnak
Copy link

jjnak commented Oct 21, 2015

Hi,

When using interactive markers with MOVE_3D and MOVE_ROTATE_3D option, I found that when the marker is clicked, the marker jumps. This happens when the marker is attached to a local coordinate frame (specified header.frame_id in InteractiveMarker) which is different from Fixed Frame specified in rviz. The amount of jump is related to the difference between the fixed frame and the local coordinates.

My guess is that this is possibly handled in moveViewPlane() in interactive_maker_control.cpp in default_plugin in rviz. With the MOVE_PLANE option, this jump does not occur. Also, when the ring and arrow are clicked with ROTATE_AXIS and MOVE_AXIS option, the jump does not happen.

I would most appreciate it if you could investigate this issue and provide a possible solution to it. I'm using ROS Hydro on Ubuntu 12.04.

The same issue has been posted in the ROS forum
http://answers.ros.org/question/138616/rviz-tf-and-interactivemarker-pose-with-respect-to-which-frame/

Follow up:
I was trying to find where this jump is happening, and most likely this function in moveViewPlane() is causing the jump.

// move parent so grab position relative to parent coincides with new mouse position.
parent_->setPose( mouse_position_on_plane - parent_to_grab_position_,
parent_->getOrientation(),
name_ );

and also it would be great if you could check these in beginMouseMovement()
grab_point_in_reference_frame_ = reference_node_->convertWorldToLocalPosition(grab_point_in_world_frame);
parent_to_grab_position_ = grab_point_in_world_frame - parent_->getPosition();

Best regards,

-Jun

@jjnak
Copy link
Author

jjnak commented Oct 22, 2015

Hi,

I further looked into this issue, and seemingly setting
parent_to_grab_position_ = Ogre::Vector3(0,0,0);

solved this problem and looks like it is working fine. So, either by setting parent_to_grab_position_ to zero, or changing the following two functions as follows might be a possible solution (removing parent_to_grab_position_ from these).

Ogre::Plane plane( event.viewport->getCamera()->getRealDirection(),
                   parent_position_at_mouse_down_);

parent_->setPose( mouse_position_on_plane,
                  parent_->getOrientation(),
                  name_ );

Your confirmation would be much appreciated!

One additional thing that I noticed that movement of the marker using MOVE_3D does not become intuitive when the local coordinate frame is rotated. Your help would be much appreciated!

Thank you,

-Jun

@jjnak
Copy link
Author

jjnak commented Oct 23, 2015

Hi,

Further to my previous post, modification of moveViewPlane() in the following way achieved the behavior that I had expected:

Ogre::Vector3 camera_direction_ = event.viewport->getCamera()->getRealDirection();
Ogre::Plane plane( reference_node_->getOrientation().Inverse()*camera_direction_,
                   parent_position_at_mouse_down_);

and

parent_->setPose( mouse_position_on_plane ,
                  parent_->getOrientation(),
                  name_ );

Best regards,

-Jun

@wjwwood
Copy link
Member

wjwwood commented Mar 22, 2016

Crossreference: #937 (comment)

@wjwwood wjwwood added this to the untargeted milestone Mar 22, 2016
@rhaschke
Copy link
Contributor

@jjnak Could you please check, that this issue is resolved by #961. You describe exactly the same behaviour I observed too.

@wjwwood wjwwood removed this from the untargeted milestone May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants