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

MoveIt Setup Assistant - Merge the Feature branch #1254

Merged
merged 30 commits into from
Jun 27, 2022
Merged

Conversation

DLu
Copy link
Contributor

@DLu DLu commented May 16, 2022

Description

MSA!

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@mergify
Copy link

mergify bot commented May 16, 2022

This pull request is in conflict. Could you fix it @DLu?

@codecov
Copy link

codecov bot commented May 16, 2022

Codecov Report

Merging #1254 (2ee96e6) into main (f4fc946) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1254      +/-   ##
==========================================
+ Coverage   61.56%   61.56%   +0.01%     
==========================================
  Files         274      274              
  Lines       24977    24977              
==========================================
+ Hits        15374    15375       +1     
+ Misses       9603     9602       -1     
Impacted Files Coverage Δ
...dl_kinematics_plugin/src/kdl_kinematics_plugin.cpp 75.36% <0.00%> (-1.07%) ⬇️
...nning_scene_monitor/src/planning_scene_monitor.cpp 45.73% <0.00%> (+0.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4fc946...2ee96e6. Read the comment docs.

Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much more than I had thought initially. Great work, everything looks really well structured and clean. This review is rather superficial, I still want to understand the architecture a little better with a second pass. Running the MSA and generating a config package worked without any issues for me. I just got stuck launching MoveGroup with it, primarily because moveit_configs_utils still seems to look for all capital yaml parameters here. With that fixed, I'm still running into some issues but will investigate them further before throwing them at you. For the remaining TODOs, it would be great if you could document them in one or multiple issues.

I assume that your are planning to preserve most of the commit history and don't want the branch to be squashed, right?
If yes, please squash some of the fix-up commits into bigger chunks, ideally the branch would not have much more than 10 commits or so. If you're fine with squashing, ignore this.

moveit_configs_utils/default_configs/stomp_planning.yaml Outdated Show resolved Hide resolved
moveit_setup_assistant/README.md Outdated Show resolved Hide resolved
return true;
}

void GroupMetaConfig::collectVariables(std::vector<moveit_setup_framework::TemplateVariable>& variables)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function doesn't look like it's of much use in a ROS 2 setting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to an example of a MoveIt config that uses additional kinematic parameters?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BioIK and TracIk use additional parameters, but they are not supported in MoveIt 2 yet

@DLu
Copy link
Contributor Author

DLu commented May 19, 2022

@DLu
Copy link
Contributor Author

DLu commented May 23, 2022

Alright team, what do we need to get this baby merged?

@vatanaksoytezer
Copy link
Contributor

I'm happy merging it as soon as we get 2 approvals. We should continue the TODO issues once this branch is merged imo. Humble release is today.

@henningkayser
Copy link
Member

henningkayser commented May 23, 2022

@DLu I'm running into some issues with generated configs. I just made a plain Panda config which went well without any issues. However, I can't launch anything without crashing. The move_group.launch.py results in this:

[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2022-05-23-20-55-24-040269-moveit2-rolling-151933
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7fedd5557400>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7fedd5557400>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x7fedd6021810>'
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/rolling/lib/python3.10/site-packages/launch/launch_service.py:228> exception=InvalidLaunchFileError('py') created at /opt/ros/rolling/lib/python3.10/site-packages/launch/launch_service.py:318> took 0.107 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 54, in get_launch_description_from_any_launch_file
    return loader(launch_file_path)
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/ubuntu/ws_ros2/install/new_panda/share/new_panda/launch/move_group.launch.py", line 6, in generate_launch_description
    moveit_config = MoveItConfigsBuilder("panda", package_name="new_panda").to_moveit_configs()
  File "/home/ubuntu/ws_ros2/install/moveit_configs_utils/lib/python3.10/site-packages/moveit_configs_utils/moveit_configs_builder.py", line 521, in to_moveit_configs
    self.trajectory_execution()
  File "/home/ubuntu/ws_ros2/install/moveit_configs_utils/lib/python3.10/site-packages/moveit_configs_utils/moveit_configs_builder.py", line 385, in trajectory_execution
    raise RuntimeError(
RuntimeError: trajectory_execution: `Parameter file_path is undefined and no matches for /home/ubuntu/ws_ros2/install/new_panda/share/new_panda/config/*_controllers.yaml

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/launch_description_sources/any_launch_description_source.py", line 53, in _get_launch_description
    return get_launch_description_from_any_launch_file(location)
  File "/opt/ros/rolling/lib/python3.10/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 57, in get_launch_description_from_any_launch_file
    raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: trajectory_execution: `Parameter file_path is undefined and no matches for /home/ubuntu/ws_ros2/install/new_panda/share/new_panda/config/*_controllers.yaml

[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: trajectory_execution: `Parameter file_path is undefined and no matches for /home/ubuntu/ws_ros2/install/new_panda/share/new_panda/config/*_controllers.yaml
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7fedd60220b0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7fedd60220b0>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7fedd60214e0>'

I get pretty much the same error when launching demo.launch.py. Is there something I'm missing? As the error indicates, there is no controllers.yaml in the config directory. I know that moveit_setup_controllers is not ported yet, but I would have expected that the produced launch files would be functional, and that the missing controller setting would simply use some default templates.

@vatanaksoytezer
Copy link
Contributor

I can confirm what Henning is seeing, I went down a bit, and the crashes seems to cause from this bit. Although the launch file don't use controllers moveit_configs_utils still checks for them. Adding a controller.yaml like panda resolves it. Ideally we should avoid that and change it in moveit_configs_utils.

@henningkayser
Copy link
Member

I can confirm what Henning is seeing, I went down a bit, and the crashes seems to cause from this bit. Although the launch file don't use controllers moveit_configs_utils still checks for them. Adding a controller.yaml like panda resolves it. Ideally we should avoid that and change it in moveit_configs_utils.

How would you run anything without controller settings?

@JafarAbdi
Copy link
Contributor

JafarAbdi commented May 24, 2022

These are the issue I had while testing:

  • We can't interact with the RViz window
  • Clicking on the RViz window and then pressing any key is causing it to segfault (maybe related to the previous point?)
Stack trace (most recent call last):
#21   Object "", at 0xffffffffffffffff, in
#20   Object "/home/jafar/workspaces/ros2/ws_moveit2_rolling/install/moveit_setup_assistant/lib/moveit_setup_assistant/moveit_setup_assistant", at 0x55d0e4920d64, in _start
#19   Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7faa778c4e3f, in __libc_start_main
#18   Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7faa778c4d8f, in
#17   Object "/home/jafar/workspaces/ros2/ws_moveit2_rolling/install/moveit_setup_assistant/lib/moveit_setup_assistant/moveit_setup_assistant", at 0x55d0e4947545, in main
#16   Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x7faa78035ce3, in QCoreApplication::exec()
#15   Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x7faa7802d74a, in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
#14   Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x7faa780880a7, in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
#13   Object "/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.1", at 0x7faa766373c2, in g_main_context_iteration
#12   Object "/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.1", at 0x7faa7668e6f7, in
#11   Object "/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.1", at 0x7faa76639d1a, in g_main_context_dispatch
#10   Object "/usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5.15.3", at 0x7faa6ad2cd6d, in
#9    Object "/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.3", at 0x7faa783eaa2b, in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
#8    Object "/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.3", at 0x7faa784114b9, in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*)
#7    Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x7faa7802ee29, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#6    Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x7faa78b1e712, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#5    Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x7faa78b7e02e, in
#4    Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x7faa7802ee29, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#3    Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x7faa78b2649d, in QApplication::notify(QObject*, QEvent*)
#2    Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x7faa78b1e712, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#1    Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x7faa78b62377, in QWidget::event(QEvent*)
#0    Object "/opt/ros/rolling/lib/librviz_common.so", at 0x7faa7935078f, in rviz_common::ToolManager::handleChar(QKeyEvent*, rviz_common::RenderPanel*)
Segmentation fault (Address not mapped to object [(nil)])
[ros2run]: Segmentation fault

@mergify
Copy link

mergify bot commented May 26, 2022

This pull request is in conflict. Could you fix it @DLu?

@mergify
Copy link

mergify bot commented May 31, 2022

This pull request is in conflict. Could you fix it @DLu?

@mergify
Copy link

mergify bot commented Jun 13, 2022

This pull request is in conflict. Could you fix it @DLu?

@mergify
Copy link

mergify bot commented Jun 14, 2022

This pull request is in conflict. Could you fix it @DLu?

@mergify
Copy link

mergify bot commented Jun 16, 2022

This pull request is in conflict. Could you fix it @DLu?

@DLu
Copy link
Contributor Author

DLu commented Jun 16, 2022

I'm sick of rebasing this. Can we merge now @henningkayser @JafarAbdi @tylerjw

@mergify
Copy link

mergify bot commented Jun 17, 2022

This pull request is in conflict. Could you fix it @DLu?

@henningkayser
Copy link
Member

I'm sick of rebasing this. Can we merge now @henningkayser @JafarAbdi @tylerjw

There is really nothing missing from my end and I'd like to get it merged as soon as possible. I've still not been able to get the generated launch files to work, and I've sunk several hours this week into it and I'm trill consulting with @vatanaksoytezer trying to figure out what's wrong. Call me nit-picky, but without me being able to launch a simple MoveGroup, I can't approve :/

@DLu
Copy link
Contributor Author

DLu commented Jun 17, 2022

I can't fix what I don't know about. Please make a ticket with diagnostic info, like any error messages you're seeing (and your moveit_config folder).

@mikeferguson
Copy link
Contributor

One note for anyone switching between branches - I had to delete install/moveit_setup* and build/moveit_setup* to get this to build (otherwise I got an error since there is no top-level CMakeLists.txt in the moveit_setup_assistant folder anymore)

@mikeferguson
Copy link
Contributor

Some testing notes on my end: was able to load my robot URDF, generate a package, and run the demo:

image

I'm sure there are still some bugs in here, but I will note this has gotten me farther in MoveIt2 than any of my attempts in the past two years - so I think we should merge this and then fix bugs as they arise.

The only bug I encountered (but, again shouldn't block merging since this probably works for 95% of use cases right now): is that adding a planning group by "links" or "joints" seems to be broken? If I add by "links", the links themselves show up as joints, along with a series of blank joints. If I add by joints, those same blank joints show up. Adding by "chain", which is probably the most common workflow, works fine.

@mikeferguson
Copy link
Contributor

mikeferguson commented Jun 21, 2022

Another update: I've managed to make this run on the real robot (simply launching the move_group.launch.py and then running moveit_rviz.launch.py). In the process I found a recent regression in the RVIZ plugins - PR opened here: #1384

I've basically got the full setup I had in ROS1 working, minus perception (which I haven't attempted to test yet - but also the README indicates that might not be functional yet due to moveit_config_utils)

Copy link
Contributor

@mikeferguson mikeferguson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used this to generate a config and get my robot on MoveIt2 - let's merge it

### Notes
* `PerceptionWidget` is ported, except `moveit_configs_utils` needs to be modified to load `sensors_3d.yaml`. This may require adjustments to the format of `sensors_3d.yaml`
* Possible bug in `PlanningGroupsWidget`: Creating a new group does not properly create a new JointModelGroup
* There are additional templates that have not been ported in the `unported_templates` folder.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this once #1387 is merged

@DLu
Copy link
Contributor Author

DLu commented Jun 27, 2022

@henningkayser Please find some time to upload your generated MoveIt config

@mikeferguson
Copy link
Contributor

@DLu were you gonna fix conflicts and merge this? I think we can deal with any issues @henningkayser is running into in other PRs - this PR is a HUGE step up from what is in the mainline codebase right now and should work for 95% of use cases (as opposed to unported stuff that works for 0%)

@gavanderhoorn
Copy link
Contributor

I think we can deal with any issues @henningkayser is running into in other PRs

I would second this.

Provided fixup PRs have a short turn-around time of course.

Many users are basically stuck without the MSA. MoveIt is too complex to not have a wizard guide them when creating new config packages (even if those config packages have been reduced in complexity (at least in the nr of files)).

@DLu
Copy link
Contributor Author

DLu commented Jun 27, 2022

I am all too happy to merge it, but I lack the permissions to do so. I can't even push to this branch on my own, which is why @vatanaksoytezer is graciously cherry-picking commits and resolving conflicts for me.

@mikeferguson
Copy link
Contributor

mikeferguson commented Jun 27, 2022

I am all too happy to merge it, but I lack the permissions to do so. I can't even push to this branch on my own

This, I did not know.

@vatanaksoytezer vatanaksoytezer merged commit 3a51feb into main Jun 27, 2022
@JafarAbdi
Copy link
Contributor

🎉 🎉 🎉 🎉 🎉

@nbbrooks
Copy link
Contributor

Hooray!! Nice work @DLu

@davetcoleman
Copy link
Member

I am so glad to see this merged in! Sorry @DLu this took so long, and thank you for your efforts. The MSA has a special place in my Willow Garage intern heart.

Shout out to @JafarAbdi @vatanaksoytezer @henningkayser for the many sub-PR reviews to get here.

Let's now button up any remaining issues :-)

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

Successfully merging this pull request may close these issues.

None yet

8 participants