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

Modified launch files tutorial, added a note to the README. #1008

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

Conversation

Jakeisthesnake
Copy link
Contributor

Description

Launch File tutorial
Added explanations for the member function of MoveItConfigsBuilder.
Added note about launch nodes for custom .cpp files.
Having made these suggestions, I now wonder if I am being too verbose and just cluttering up the documentation when someone wanting to learn more can do what I did and read the source code. So maybe the launch file tutorial should remain unchanged.

README
Added a note that building MoveIt can be skipped if only adding explanations, note any executable code. This is mostly addressing my own pain of building MoveIt (about a 3-4 hour process) and I could see it stopping someone from adding a few helpful comments.

Please explain the changes you made, including a reference to the related issue if applicable

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • While waiting for someone to review your request, please consider reviewing another open pull request to support the maintainers

…mber funtions.

Added note to Launch FIles tutorial about nodes for custom cpp files.
Added note to README.md that building Moveit is not needed if only adding explinations, not exectuable code. This is mostly addressing the pain I feel of building MoveIt (3-4 hours on my laptop). Maybe I am an anomily.
@Jakeisthesnake
Copy link
Contributor Author

As an aside, I would have liked to add more about '.planning_scene_monitor()' regarding when you need to set its parameters to be true, but I haven't found good explanations regarding common uses cases. If you can point me in the direction of where to learn more, I would be happy to add that info to the tutorial.

Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

Thank you for getting this started!

My first response here is that the information being added is largely already available in other tutorials. I would recommend reading through some of the other pages I've linked in the comments, and seeing if there's a better way to take advantage of cross-linking doc pages, but keeping each individual page focused on a specific subset of topics.

@Jakeisthesnake
Copy link
Contributor Author

Ok, I'll make those edits. Do you know if any of the tutorials discuss the parameters for .planning_scene_monitor()? It seems lacking from the moveit_configuration_tutorial.

@sea-bass
Copy link
Contributor

Ok, I'll make those edits. Do you know if any of the tutorials discuss the parameters for .planning_scene_monitor()? It seems lacking from the moveit_configuration_tutorial.

Thanks!

Maybe those could be mapped to the concepts page at https://moveit.picknik.ai/main/doc/concepts/planning_scene_monitor.html and/or https://moveit.picknik.ai/main/doc/examples/planning_scene_monitor/planning_scene_monitor_tutorial.html ?

@Jakeisthesnake
Copy link
Contributor Author

Yeah, I can start with those.

@Jakeisthesnake
Copy link
Contributor Author

Jakeisthesnake commented Jan 24, 2025

If I wanted to cross link to the CMakeLists.txt file in the root moveit2_tutorials directory, how would I do that?
:doc:moveit2_tutorials/CMakeLists.txt (the backticks turn "moveit2_tutorials/CMakeLists.txt" into inline code)
doesn't seem to work. I assume that is because :doc: only works for files in the doc folder? I also assume that it would be poor form to directly link to "https://github.com/moveit/moveit2_tutorials/blob/main/CMakeLists.txt"

@sea-bass
Copy link
Contributor

If I wanted to cross link to the CMakeLists.txt file in the root moveit2_tutorials directory, how would I do that? :doc:moveit2_tutorials/CMakeLists.txt (the backticks turn "moveit2_tutorials/CMakeLists.txt" into inline code) doesn't seem to work. I assume that is because :doc: only works for files in the doc folder? I also assume that it would be poor form to directly link to "https://github.com/moveit/moveit2_tutorials/blob/main/CMakeLists.txt"

I believe you can use :codedir: -- you can see the definitions here, and also search for similar usages in the .rst files in these docs.

There are other handy ones for linking to e.g. source code in the MoveIt 2 repo, etc.

@Jakeisthesnake
Copy link
Contributor Author

Thanks!

@Jakeisthesnake
Copy link
Contributor Author

I may be reading the definition wrong, but it looks like codedir can only reference stuff in the doc folder?

"codedir": (
        "https://github.com/"
        + html_context["github_user"]
        + "/moveit2_tutorials/blob/"
        + html_context["github_version"]
        + "doc/%s",
        "",

@sea-bass
Copy link
Contributor

It does look that way -- maybe instead of linking to the existing repo's CMakeLists.txt, you can just copy-paste a small relevant snippet of what you intend to show?

I assume this is just the compilation of a specific executable given source files?

@Jakeisthesnake
Copy link
Contributor Author

Yeah I could do that. Just walking through the CMakeLists.txt file for moveit_cpp tutorial.

Added a link in the launch tutorial to the moveit_cpp tutorial.
Added the CMakeLists.txt code and expliantions to the moveit_cpp tutorial.
@Jakeisthesnake
Copy link
Contributor Author

Updated the tutorial:
Moved most of the config specific edits to the configuration tutorial.
Aside from adding a link in the launch tutorial to the moveit_cpp tutorial, the launch tutorial went back to how it was.
Added the CMakeLists.txt code and explications to the moveit_cpp tutorial.

Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes! I think this is looking good, as most of my remaining comments are small.

Comment on lines +47 to +50
The CMakeLists.txt File
-----------------------
During the build process, the CMakeLists.txt file assigns where the launcher will look for the executable.
Below is the CMakeLists.txt file for this tutorial:
Copy link
Contributor

Choose a reason for hiding this comment

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

Add code font: ``CMakeLists.txt`` to all these mentions

Also "launcher" --> "launch file"

output="screen",
parameters=[moveit_config.to_dict()],
)
This node contains parameters which are passed to the executable associated with moveit_cpp_tutorial.
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ``code_font`` here for the tutorial name

DESTINATION share/${PROJECT_NAME}
)

``add_executable`` builds the executable named moveit_cpp_tutorial from the source file ``src/moveit_cpp_tutorial.cpp``.
Copy link
Contributor

Choose a reason for hiding this comment

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

code font for the executable name here too

``PUBLIC`` makes the include directory available to targets that depend on ``moveit_cpp_tutorial``.

``ament_target_dependencies`` specifies dependencies for the moveit_cpp_tutorial executable.
``${THIS_PACKAGE_INCLUDE_DEPENDS}`` is a variable defined in the ``moveit2_tutorials`` root directory's CMakeLists.txt file, which list common dependencies used in moveit2_tutorials.
Copy link
Contributor

Choose a reason for hiding this comment

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

code font for all the things here as well

``target_include_directories`` specifies the directories to search for header files during compilation.
``PUBLIC`` makes the include directory available to targets that depend on ``moveit_cpp_tutorial``.

``ament_target_dependencies`` specifies dependencies for the moveit_cpp_tutorial executable.
Copy link
Contributor

Choose a reason for hiding this comment

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

and here

Comment on lines +44 to +45
)
This node contains parameters which are passed to the executable associated with moveit_cpp_tutorial.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Add a blank line in between these 2 -- although it seems to render fine as is

Comment on lines +208 to +232
``.robot_description`` can optionally take a file path to ``robot_name.urdf`` and/or assign a dictionary of argument mappings that are passed to the robot's urdf.xacro file.
The file path to ``robot_name.urdf`` must be relative to your robot package, so if your robot package is ``/robot_package`` and the urdf (or urdf xacro) file is ``robot_package/config/robot_name.urdf``
you would pass ``.robot_description(filepath="config/robot_name.urdf")``.
If you don't provide a file path, but you do give ``MoveItConfigsBuilder`` a robot name (see above paragraph), MoveIt will look for ``robot_package/config/robot_name.urdf``.

``.trajectory_execution`` loads trajectory execution and MoveIt controller manager's parameters from an optionally provided file path.
If a file path isn't given, MoveIt looks for files in the package's ``config`` folder for files ending with ``controllers.yaml``.

``.planning_scene_monitor`` allows you to set various parameters about what scene information is published and how often is it published.

``.planning_pipelines`` allows to you to list the names of the planners you want available to be used by your robot.
If you opt to not list pipelines, as in ``.planning_pipelines()``, MoveIt will look in the config folder of your package for files that end with "_planning.yaml".
Additionally, if no pipelines are listed, MoveIt will load a set of planners from its own library - this can be disabled adding ``load_all=False`` as an argument to ``.planning_pipelines``.
Listing the planner names specifiies which planners MoveIt should load; again these should be in your config folder.
MoveIt will also pick one of your planners to be the default planner.
If OMPL is one of your planners, it will be the default planner unless you set ``default_planning_pipeline`` to your desired default planner as in

.. code-block:: python

.planning_pipelines(
pipelines=["ompl", "your_favorite_planner"],
default_planning_pipeline="your_favorite_planner",
)

If OMPL is not in your planner list and you don't set a default planner, MoveIt will pick the first planner in the list.
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider putting this in a bulleted list. Right now it renders like this which is a little dense to parse

image

Comment on lines +208 to +232
``.robot_description`` can optionally take a file path to ``robot_name.urdf`` and/or assign a dictionary of argument mappings that are passed to the robot's urdf.xacro file.
The file path to ``robot_name.urdf`` must be relative to your robot package, so if your robot package is ``/robot_package`` and the urdf (or urdf xacro) file is ``robot_package/config/robot_name.urdf``
you would pass ``.robot_description(filepath="config/robot_name.urdf")``.
If you don't provide a file path, but you do give ``MoveItConfigsBuilder`` a robot name (see above paragraph), MoveIt will look for ``robot_package/config/robot_name.urdf``.

``.trajectory_execution`` loads trajectory execution and MoveIt controller manager's parameters from an optionally provided file path.
If a file path isn't given, MoveIt looks for files in the package's ``config`` folder for files ending with ``controllers.yaml``.

``.planning_scene_monitor`` allows you to set various parameters about what scene information is published and how often is it published.

``.planning_pipelines`` allows to you to list the names of the planners you want available to be used by your robot.
If you opt to not list pipelines, as in ``.planning_pipelines()``, MoveIt will look in the config folder of your package for files that end with "_planning.yaml".
Additionally, if no pipelines are listed, MoveIt will load a set of planners from its own library - this can be disabled adding ``load_all=False`` as an argument to ``.planning_pipelines``.
Listing the planner names specifiies which planners MoveIt should load; again these should be in your config folder.
MoveIt will also pick one of your planners to be the default planner.
If OMPL is one of your planners, it will be the default planner unless you set ``default_planning_pipeline`` to your desired default planner as in

.. code-block:: python

.planning_pipelines(
pipelines=["ompl", "your_favorite_planner"],
default_planning_pipeline="your_favorite_planner",
)

If OMPL is not in your planner list and you don't set a default planner, MoveIt will pick the first planner in the list.
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider linking to the OMPL Planner doc page here

@@ -47,7 +47,7 @@ A handy way to refer to a MoveIt configuration package is to use the ``MoveItCon
Launching Move Group
--------------------

Once all the MoveIt configuration parameters have been loaded, you can launch the :ref:`Move Group Interface` using the entire set of loaded MoveIt parameters.
Once all the MoveIt configuration parameters have been loaded, you can define the :ref:`Move Group Interface` Node using the entire set of loaded MoveIt parameters.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Once all the MoveIt configuration parameters have been loaded, you can define the :ref:`Move Group Interface` Node using the entire set of loaded MoveIt parameters.
Once all the MoveIt configuration parameters have been loaded, you can define the :ref:`Move Group Interface` node using the entire set of loaded MoveIt parameters.

Comment on lines +218 to +221
Launching a custom executable
----------------------------

Later on these tutorials (:doc:`/doc/examples/moveit_cpp/moveit_cpp_tutorial`), you will learn how to create and launch a custom executable.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove this.

@sea-bass sea-bass changed the title Modified Luanch files tutorial, added a note to the README. Modified launch files tutorial, added a note to the README. Feb 8, 2025
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.

2 participants