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

Non-static transform from base_link to camera #496

Open
MikeWrockAIS opened this issue Nov 22, 2019 · 8 comments
Open

Non-static transform from base_link to camera #496

MikeWrockAIS opened this issue Nov 22, 2019 · 8 comments
Assignees

Comments

@MikeWrockAIS
Copy link

I noticed that even though you can set the frame in which to publish the ZED's odometry information, the current TF is not used. For example: if the camera is on a moving arm, when the arm moves the camera will publish odometry as if base_link moved, ignoring the current base_link to camera transform. Is there any way to tell the zed-wrapper the camera moves relative to base link during operation?

@Myzhar Myzhar self-assigned this Nov 22, 2019
@Myzhar
Copy link
Member

Myzhar commented Nov 22, 2019

Hi @MikeWrockAIS
the default URDF is designed for robots with the camera statically linked to base_link, but you can change it according to your configuration.

In your case you can simply change the type of joint between zed_camera_center and base_link from fixed to floating
https://github.com/stereolabs/zed-ros-wrapper/blob/master/zed_wrapper/urdf/zed.urdf#L25

In this way the robot_state_publisher will not publish the relative TF, but you should do it in one of your nodes, otherwise the TF of the ZED will result as broken.

@MikeWrockAIS
Copy link
Author

Does it have to be the zed_camera_center to base_link joint that is floating or can it be one joint along the TF tree such as:
base_link -> rotating_arm (floating)
rotating_arm -> zed_camera_center (fixed)

@Myzhar
Copy link
Member

Myzhar commented Nov 25, 2019

It depends on your configuration. You should modify the ZED URDF according to how the camera is linked on the robot. The important thing is that the chain zed_camera_center -> .... -> base_link is not broken and the ROS TF can always calculate the zed_camera_center -> base_link transform

@MikeWrockAIS
Copy link
Author

It seems like once a valid transform from camera to base link is acquired mCamera2BaseTransfValid is set to true. Since the transform is only updated if mCamera2BaseTransfValid is false, I don't see how providing an up to date TF tree helps. Perhaps I should set mCamera2BaseTransfValid to false or simply remove the if statement and call getCamera2BaseTransform() every time?

@Myzhar
Copy link
Member

Myzhar commented Nov 25, 2019

Yes, in your case you must update it at every cycle so you must remove the check.
We will add a parameter to discriminate between static and not static transform.

@MikeWrockAIS
Copy link
Author

awesome, thanks a lot

@Myzhar Myzhar reopened this Nov 25, 2019
@Myzhar
Copy link
Member

Myzhar commented Nov 25, 2019

I keep the issue open as reminder for the feature to be added

@tugbakara
Copy link

I have a smilar issue, tomorrow I will open a new issue and add the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants