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

Migrate to AWS warehouse simulation scenario #2797

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

lucabonamini
Copy link
Contributor


Basic Info

Info Please fill out this column
Ticket(s) this addresses
Primary OS tested on Ubuntu
Robotic platform tested on Personal laptop

Description of contribution in a few bullet points

  • Changed tests simulation scenario from turtlebot world to AWS warehouse

Description of documentation updates required from your changes


Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in navigation.ros.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

@mergify
Copy link
Contributor

mergify bot commented Feb 2, 2022

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

@mergify
Copy link
Contributor

mergify bot commented Feb 2, 2022

@lucabonamini, please properly fill in PR template in the future. @SteveMacenski, use this instead.

  • Check that any new parameters added are updated in navigation.ros.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

@mergify
Copy link
Contributor

mergify bot commented Feb 2, 2022

@lucabonamini, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

@mergify
Copy link
Contributor

mergify bot commented Feb 2, 2022

@lucabonamini, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

@mergify
Copy link
Contributor

mergify bot commented Feb 2, 2022

@lucabonamini, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

@lucabonamini lucabonamini marked this pull request as ready for review February 5, 2022 17:03
@mergify
Copy link
Contributor

mergify bot commented Feb 5, 2022

@lucabonamini, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

@SteveMacenski
Copy link
Member

@lucabonamini what's the status here?

@mergify
Copy link
Contributor

mergify bot commented Mar 24, 2022

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

@SteveMacenski
Copy link
Member

I don't suppose you have a video of a few of the jobs running / starting positions (particularly the keepout or speed zones one)? That would help to put a graphic to the changes in starting pose / test zones

@lucabonamini
Copy link
Contributor Author

lucabonamini commented Mar 24, 2022

I don't suppose you have a video of a few of the jobs running / starting positions (particularly the keepout or speed zones one)? That would help to put a graphic to the changes in starting pose / test zones

Just tell me which photos / videos you want, I'll do them asap 😃

@SteveMacenski
Copy link
Member

the keepout zone test and the default nav2_bringup launch file position would be good enough for me!

@mergify
Copy link
Contributor

mergify bot commented Apr 4, 2022

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

@AlexeyMerzlyakov
Copy link
Collaborator

If I commit the roll-back version, could you or @SteveMacenski give it a try on your laptop?

I've checked it today locally. That is also does not work for me with the same assertion px != 0 failed issue when using latest refactor/aws branch and works fine from main one. I've started to compare what else was happened between main and development branch and found out that for the problem fails it was responsible GAZEBO_RESOURCE_PATH environment variable. Setting it to non-empty will cause the problem even on main branch:

[leha@leha-PC nav2_ws]$ export GAZEBO_RESOURCE_PATH=abracadabra
[leha@leha-PC nav2_ws]$ ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False 2>&1 | tee run.log
...
[gzserver-1] gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::rendering::Scene; typename boost::detail::sp_member_access<T>::type = gazebo::rendering::Scene*]: Assertion `px != 0' failed.
[ERROR] [gzserver-1]: process has died [pid 102349, exit code -6, cmd 'gzserver -s libgazebo_ros_init.so -s libgazebo_ros_factory.so /home/leha/nav2_ws/install/nav2_bringup/share/nav2_bringup/worlds/world_only.model'].
[gzclient-2] gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::rendering::Camera; typename boost::detail::sp_member_access<T>::type = gazebo::rendering::Camera*]: Assertion `px != 0' failed.
[ERROR] [gzclient-2]: process has died [pid 102351, exit code -6, cmd 'gzclient'].

Could we live without this environment variable in Nav2 launch-scripts?

@AlexeyMerzlyakov
Copy link
Collaborator

AlexeyMerzlyakov commented May 23, 2022

I am also have one note appeared when locally launched the TB3 simulation in AWS:

Also I forgot this space is somewhat large, please increase the maximum range on the lidar from whatever it is now to like 20m so we have visibility. The toy TB3 lidar isn't long enough range for this size of open space to stay even remotely localized

The maximum laserscan range now changed from 3.5m -> to 20m. I think, we need to reflect these changes in the ROS2 params, such as the size of local costmap (width and height params) and raytrace_max_range/obstacle_max_range for laser scanner in both local and global costmaps. I would increase them by 2x-3x times comparing to original values. @SteveMacenski, did I forget something here (like laser_likelihood_max_dist for AMCL where I still doubting: according to docs it seems this value should be untouched as it is related to AMCL inflation algorithms internals and not dependent on maximum laserscan range)?

@AlexeyMerzlyakov
Copy link
Collaborator

AlexeyMerzlyakov commented May 23, 2022

And, the latest comment: @lucabonamini, please do a rebase of your changes over latest main branch, in order to avoid merges and "intertwined" non-linear history in main.

@SteveMacenski
Copy link
Member

SteveMacenski commented May 23, 2022

The max range is already set to 100 https://github.com/ros-planning/navigation2/blob/main/nav2_bringup/params/nav2_params.yaml#L17 so I think it should be OK. If you change it from 3.5->20 and you see that the robot isn't getting totally lost when moving from the starting position across the map anymore, then its fixed and I think you're fine. If its still being weird, yeah we should play with it more, but no, we should not adjust the costmaps.

We broadly need to do a cleanup of parameters and plugins in the default bringups, so we can keep that in mind, but I figure we do that once we have either (1) MPPI in the stack or (2) we swap out robots to another platform.


Do all the tests use that same nav2_bringup/worlds/waffle.model? If not, we should also update it to 20 in all the system test copies of the TB3 model


From current state of branch I get the following while just trying to load the world

[gzserver-1] gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::rendering::Scene; typename boost::detail::sp_member_access<T>::type = gazebo::rendering::Scene*]: Assertion `px != 0' failed.
[gzclient-2] gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::rendering::Camera; typename boost::detail::sp_member_access<T>::type = gazebo::rendering::Camera*]: Assertion `px != 0' failed.

@AlexeyMerzlyakov
Copy link
Collaborator

AlexeyMerzlyakov commented May 24, 2022

From current state of branch I get the following while just trying to load the world

This is related to #2797 (comment). Currently refactor/aws branch still has GAZEBO_RESOURCE_PATH variable set, so the problem most likely to appear:

    model, plugin, media = GazeboRosPaths.get_paths()
...
    if 'GAZEBO_RESOURCE_PATH' in environ:
        media += pathsep+environ['GAZEBO_RESOURCE_PATH']
...
    env = {'GAZEBO_MODEL_PATH': model,
           'GAZEBO_PLUGIN_PATH': plugin,
           'GAZEBO_RESOURCE_PATH': media}
...
    start_gazebo_server_cmd = ExecuteProcess(
        condition=IfCondition(use_simulator),
        cmd=['gzserver', '-s', 'libgazebo_ros_init.so',
             '-s', 'libgazebo_ros_factory.so', world],
        additional_env=env,
        cwd=[aws_dir], output='screen')

    start_gazebo_client_cmd = ExecuteProcess(
        condition=IfCondition(PythonExpression(
            [use_simulator, ' and not ', headless])),
        cmd=['gzclient'],
        additional_env=env,
        cwd=[aws_dir], output='screen')

When removing this variable from environments, the problem vanished on my side.


Update: the problem is that we set env['GAZEBO_RESOURCE_PATH'] to media variable in any case, even if this variable is not in the environment. So, it is needed to be assigned inside if-statement to fix. Something like:

    if 'GAZEBO_MODEL_PATH' in environ:
        model += pathsep+environ['GAZEBO_MODEL_PATH']
        env['GAZEBO_MODEL_PATH'] = model
    if 'GAZEBO_PLUGIN_PATH' in environ:
        plugin += pathsep+environ['GAZEBO_PLUGIN_PATH']
        env['GAZEBO_PLUGIN_PATH'] = plugin
    if 'GAZEBO_RESOURCE_PATH' in environ:
        media += pathsep+environ['GAZEBO_RESOURCE_PATH']
        env['GAZEBO_RESOURCE_PATH'] = media

@SteveMacenski
Copy link
Member

Sounds reasonable!

@SteveMacenski
Copy link
Member

SteveMacenski commented May 26, 2022

So just that change and this should be good to go?


Crazy irritating, but ROS 2 depreciates Gazebo and we have to move to Ignition either sooner (if we can't get gazebo ros plugins released) or later (if we can, but sometime this year). So I've filed a ticket aws-robotics/aws-robomaker-small-warehouse-world#22 about getting the AWS warehouse world into Ignition so that after this PR is merged, the system tests work remains the same, but we would change the gz calls to ign calls and call it a day.

What's somewhat in question though is if we should move to using a ignition provided warehouse world 1 or 2 rather than the AWS warehouse world. I rather like the AWS warehouse world and I really appreciate all the time you've put into this and want that to be reflected in the stack. But curious if you had thoughts on it and if you think one of these worlds might be better for some reason. I don't think its worth redoing all this work to move to a slightly different warehouse if we can get the AWS world in Ignition, you'd done enough and I want to get this work in.

@mergify
Copy link
Contributor

mergify bot commented May 27, 2022

@lucabonamini, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

@mergify
Copy link
Contributor

mergify bot commented May 27, 2022

@lucabonamini, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

@lucabonamini
Copy link
Contributor Author

lucabonamini commented May 27, 2022

So just that change and this should be good to go?

I pushed the change @AlexeyMerzlyakov suggested, but at the moment i can't test it locally as i am having a lot of problems with gazebo.

Crazy irritating, but ROS 2 depreciates Gazebo and we have to move to Ignition either sooner (if we can't get gazebo ros plugins released) or later (if we can, but sometime this year). So I've filed a ticket aws-robotics/aws-robomaker-small-warehouse-world#22 about getting the AWS warehouse world into Ignition so that after this PR is merged, the system tests work remains the same, but we would change the gz calls to ign calls and call it a day.

What's somewhat in question though is if we should move to using a ignition provided warehouse world 1 or 2 rather than the AWS warehouse world. I rather like the AWS warehouse world and I really appreciate all the time you've put into this and want that to be reflected in the stack. But curious if you had thoughts on it and if you think one of these worlds might be better for some reason. I don't think its worth redoing all this work to move to a slightly different warehouse if we can get the AWS world in Ignition, you'd done enough and I want to get this work in.

I've checked Ignition warehouse worlds, and they seem very similar to the one provided by AWS. Currently I cannot estimate the effort to migrate to these new worlds, but I think the best choice is closely linked to which of the worlds will be actively supported in the future.

As you said, migrate AWS world in Ignition would be the best choice right now 😄

@lucabonamini
Copy link
Contributor Author

@SteveMacenski I think i will have to restart from a clean install of Ubuntu and ROS to fix the problems I'm facing.

@SteveMacenski
Copy link
Member

OK! I think our plan is to stick with the AWS world and have that migrated to Ignition. I don't want to redo your work and you've done so much here, I want your hard work reflected. And as the project leader, I can just make that executive decision 😆

@mergify
Copy link
Contributor

mergify bot commented May 27, 2022

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

@mergify
Copy link
Contributor

mergify bot commented Jun 1, 2022

@lucabonamini, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

@lucabonamini
Copy link
Contributor Author

@SteveMacenski I've tested last changes with a fresh ROS installation, and I was able to successfully launch tb3_simulation_launch.py with no need for sourcing /usr/share/gazebo/setup.bash.

Now CI is failing due to some problem related to aws-robomaker-small-warehouse-world rolling debian.

@SteveMacenski
Copy link
Member

SteveMacenski commented Jun 1, 2022

sigh I'm not sure. It appears that it hasn't been released to 22.04 because the release bin jobs are disabled in Rolling. It also has listed dependencies on gazebo which also doesn't exist in 22.04 so that's an issue regardless

Unfortunately since you pulled in updated amcl code for 22.04, it broke my install on 20.04, I can no longer test this until I can get my work machine updated to 22.04 (which then wouldn't work because AWS warehouse doesn't exist -- so this PR is in a bit of a catch 22, I'd revert the 22.04 AMCL stuff so this still works on 20.04 for the time being).

This gazebo / 22.04 issue is kill'n me

@lucabonamini
Copy link
Contributor Author

lucabonamini commented Jun 1, 2022

sigh I'm not sure. It appears that it hasn't been released to 22.04 because the release bin jobs are disabled in Rolling. It also has listed dependencies on gazebo which also doesn't exist in 22.04 so that's an issue regardless

Unfortunately since you pulled in updated amcl code for 22.04, it broke my install on 20.04, I can no longer test this until I can get my work machine updated to 22.04 (which then wouldn't work because AWS warehouse doesn't exist -- so this PR is in a bit of a catch 22, I'd revert the 22.04 AMCL stuff so this still works on 20.04 for the time being).

Maybe should I cherry-pick my last commit and push to main branch right before the changes in amcl? Although the issue with AWS warehouse remains.

This gazebo / 22.04 issue is kill'n me

How can I help?

@SteveMacenski
Copy link
Member

Wait - gazebo in 22.04 should be working actually from discussions on another thread, I'm not sure why then the aws warehouse world isn't released / handled.

@SteveMacenski
Copy link
Member

SteveMacenski commented Jun 23, 2022

@nuclearsandwich released AWS Warehouse world for Humble/Rolling so this should turn over in the next sync!

@lucabonamini @AlexeyMerzlyakov is this ready to merge otherwise?

@lucabonamini
Copy link
Contributor Author

Any updates? @SteveMacenski

@SteveMacenski
Copy link
Member

Still no update yet for Rolling / Humble, so still waiting...

@mergify
Copy link
Contributor

mergify bot commented Mar 20, 2023

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

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Oct 1, 2023

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

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

4 participants