AIS-Bonn / rviz_cinematographer

Easy to use tools to create and edit trajectories for the rviz camera.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

merge the changes into rviz_animated_view_controller

flynneva opened this issue · comments

Hi AIS-Bonn,

first off - amazing work!!! this package is incredible and I will definitely be using it in the future. In the mean time, I am in the process taking over maintenance and trying to publish the rviz_animated_view_controller for ROS Noetic, and then migrating it to ROS2 after that, and I was wondering if you would be willing to make a PR to incorporate your changes here to your rviz_cinematographer_view_controller into the same package.

This should lighten the load of what needs to be maintained here once it is released so it should help you out too.

Anyways, let me know what you think and looking forward to hearing from you!

Hey,

thank you! I'm always very happy to hear that this package is helping others :)

I've already thought about cleaning up my code and adding some minor improvements.
Incorporating my changes to the rviz_animated_view_controller seems like a good place to start.
On the other hand, my view controller is coupled rather tightly to the GUI and the video recorder, by depending on the messages these packages exchange and process.
At least this was my impression after having a quick look at my code - it's been a while ;)

To make sure I understood correctly, you want (me) to incorporate just the changes I made to the view controller?
Without the GUI or the option to record a video from the camera's view, right?

In any case, thank you for taking over maintenance for the animated view controller after such a long time without an active maintainer.

@Razlaw correct - I think the Rviz animated controller should be it's own package in its own right and then on that package we can link to this one for GUI/video creation support.

Let me know if you think there might be a better way to split up the requirements for each...still getting familiar with them both honestly.

I'm not entirely sure what the original purpose of the rviz_animated_view_controller was and what it was intended for.
Probably to receive a CameraPlacement message and move the camera to the target pose?!?
I just adapted it for my GUI, which was a good fit.

If I remember correctly, I just added some methods I needed and didn't mess with the original code besides cleaning the random formatting of the code.
The new methods required some new message types.
I split up the original CameraPlacement message into my CameraMovement and CameraTrajectory messages to be able to send a list of target poses and parameters defining how the camera should move. This required some additional fields in the message definitions.
Maybe the readme for the package structure gives a better overview of what I'm talking about.

Long story short, if you don't mind the additional methods and the messages that are rather specific to my GUI the integration should be pretty straight forward. Besides the refactoring of the code ;)
We would need to make changes to the ros-visualization/view_controller_msgs for that. Since you are the maintainer of the view controller package, you probably should be the maintainer of the corresponding msgs package as well.

Currently I don't see a better way to split the packages.
Take your time getting familiar with the packages. I did too before programming the GUI.
I think the GUI is a good starting point to see which methods get called when specific actions happen. If I remember correctly the view controller is a little confusing at the start - at least it was for me.
I'm pretty busy this week. We could start integrating next week, or whenever you feel familiar enough with the packages.

Okay, I've had a deeper look at the changes I've made now.
In the current state my view controller is not backwards compatible, but I've got an idea how to make that happen.

The functionality I added for my GUI and the recorder to communicate to the view controller is very limited and rather general.
In my eyes it makes sense to keep it, because others might be interested in using it as well + everything is optional and deactivated by default.

If you are finished getting familiar with the code, we could start thinking about how to integrate the changes best.
I'm not sure whether this is the best place to discuss this, though.
Do you think the maintainer of the view_controller_msgs package is still active and willing to add some message types?

it looks like view_controller_msgs was written by the same guy, Adam Leeper. I'll make a PR to be added as a maintainer there too and hopefully get write access rights to merge in PRs.....still waiting for that on the original one.

I'll follow up on this tomorrow

@Razlaw just following up on this - was finally able to get added to both rviz_animated_view_controller and view_controller_msgs.

should now be able to propose any changes we would like to and get the approved fairly quickly (by myself if needed). if there are changes to the view_controller_msgs that you'd like to add maybe lets start there.

once those are in we can see about adding other changes to the other package.

Concerning the view controller package.
I've decoupled my view controller from my GUI and recorder packages.
After the pull request for the view_controller_msgs package is merged, the view controller wouldn't depend on my GUI and recorder anymore.
Additionally I've reintroduced a subscriber for the original CameraPlacement messages to make my view controller backwards compatible.

The next step would be to incorporate the changes into the rviz_animated_view_controller.
Do you have a preference how I should structure the pull requests?
One big "add support for camera view trajectories" pull request with several commits adding the separate needed functions step by step.
Or several pull requests, each one adding one aspect of the new methods - like publishing the camera poses, publishing the view images, adding support for trajectory messages and so on.

Once you are able to merge pull requests it would be helpful if you could merge your noetic branch adding qt5 support to the official rviz_animated_view_controller package to prevent unnecessary merge conflicts.

awesome write-up!

no preference from my side as to how to structure the PR(s). it might make it easier for others to understand what we are doing if we make issues on the rviz_animated_view_controller package tracking each new feature with a brief sentence or two on the purpose of it. then if you do a single PR or multiple we can just reference the separate issues as needed.

if you could merge your noetic branch adding qt5 support to the official rviz_animated_view_controller package

definitely will do this ASAP. i can even open the PR before I get merging rights and just have it there waiting.

i just was granted merge access I think! so now we should be "good to go" to go forward for now.

while reviewing the currently open PR's I realized someone had already contributed a fix for detecting the Qt version. bringing it over now to noetic and I merged that PR in to the indigo branch: https://github.com/ros-visualization/rviz_animated_view_controller/pull/9/commits

it looks like there is an open PR for publishing the camera poses already too. does this implement the same logic that you wanted to add as well?

No, the other pull request wants to publish the current rviz camera pose as a CameraPlacement message, which is originally used by the rviz_animated_view_controller to specify where the camera should move to and how fast.
I use a simple geometry_msgs::Pose message.

Furthermore the other PR publishes the camera pose only when the camera is moved using the mouse.
I publish the pose continuously with every new update.

I'm not sure what the other PR intended to do with the camera pose and why only publishing changing the view with the mouse.
Maybe you should ask the author before merging.

i think ill wait to comment on that PR until you open yours. that way I can reference it asking if the new one covers their use-case.

The first and major pull request for the rviz_animated_view_controller is in.
The remaining will be straight forward just adding very distinct functions.
But I think it would be helpful to merge the big one first.

Could you merge the PR from the view_controller_msgs package?

Could you merge the PR from the view_controller_msgs package?

unfortunately I still dont have merge access for the view_controller_msgs to merge....only rviz_animated_view_controller as of today. ill keep pinging people to see if I can get added.

image

A little update:
I'm currently working on the other issues/pull requests.
Most are independent of the new trajectory messages.
But the PR introducing the new messages changed the main loop quite a bit.
The remaining PRs would add some lines to the main loop as well.
In my opinion it would be easier to merge the remaining PRs one by one after the first PR.
The alternative would generate a lot of merge conflicts.

I already prepared the PR to publish the view images, but it adds a line to the callback for the trajectory messages.
I stored it in my fork basing it on the first PR, because I saw no better option, while the first PR is not merged.
I will move it to the base repository after the merge.
You can review it if you want to.

Alternatively you could create a new branch in the rviz_animated_view_controller repository and merge my first PR there.
Then I could add the remaining PRs to that branch.
And after the new trajectory messages are merged in the view_controller_msgs repository you could just merge the changes from the new branch to noetic-devel.

@Razlaw just was able to get access to merge view_controller_msgs.

are those the last changes to the msgs that we need? should i go ahead and try and release a new version with those changes now?

Yes, these are the only changes necessary for the messages. The remaining changes are only in the view controller package.
You can release a new version now.

finally got access to everything (I think).

i'll bump and try a new release for the msgs repo.

open PR's to update the view_controller_msgs package for both melodic and noetic

Great work 👍

Just to be on the safe side

open PR's to update the view_controller_msgs package for both melodic and noetic

You opened the PR's and that's no assignment/command for me, correct?

You opened the PR's and that's no assignment/command for me, correct?

Correct - just keeping you in the loop!

In the mean time until those get merged and released we can work on the other work that needs to be done. I'll start digging into this more since now there is nothing blocking us I think.

@flynneva These are the remaining changes.
The PRs are rather concise.
They don't depend on each other but add code into very similar parts of the existing code - meaning there shouldn't be any merge conflicts and if there are just keep both changes :)

@Razlaw just fixed the package.xml dependencies. looks like the view_controller_msgs isnt released yet for noetic but it is released for melodic.

reviewing your PR's now.

@flynneva to be honest, I'm still using melodic and Ubuntu 18.04. but there was a PR #6 for this package fixing the includes to work with noetic and Ubuntu 20.04.
Making the latest version of the rviz_cinematographer work with melodic and noetic since the end of 2020.
I'm aware that this is far from being a best practice, but since I didn't add any new functionality and just copied parts until both my and the official view controllers are virtually the same, I hope this was okay.
In the end you surely test what I PR to the official repo :)

Long story short, all changes work with melodic and Ubuntu 18.04. as well.
If you want, you can transfer the changes I made to the melodic branches.
I PRed them to the noetic branches because you wrote you want to publish the changes to the noetic branch in your first message here.

@Razlaw your PRs were fine!!!! just for some reason GitHub wasn't diff'ing correctly when trying to merge.

The PR you just closed, could you rebase it with the noetic-devel branch and reopen it?

The necessary changes are merged now.
The only remaining differences between the view controllers are:

  1. a method publishing an empty message every time the "delete" key was pressed. I used that to conveniently delete the currently selected marker in the GUI,
  2. and a basic refactoring.
  3. (and a publisher for odometry messages of the moving camera, but that was a relic that wasn't used)

I didn't make a PR for the delete key publisher because it seemed very specific and a little misplaced in the official view controller.
I can add it if you don't mind, but it's no must have for me.

ill be testing the rviz_animated_view_controller package later this week. hoping to tag an initial release by sunday hopefully and then see if we can bloom it as well.

if you dont mind im going to close this in favor of issues on rviz_animated_view_controller to track on-going development.

thanks again so much for your efforts here!!!!!

@flynneva Thank you for maintaining the rviz_animated_view_controller and giving me the opportunity to contribute to the official ROS packages :)