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 Luanch files tutorial, added a note to the README. #1008

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Below are some links to help with the ports.

## MoveIt Tutorials Source Build

(This section can be skipped if you aren't adding executable code. You don't need to build MoveIt to add an explanation about something.)
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


Follow the [MoveIt Source Build](https://moveit.ros.org/install-moveit2/source/) instructions to set up a colcon workspace with MoveIt from the source.

Open a command line to your colcon workspace:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,44 @@ A handy way to refer to a MoveIt configuration package is to use the ``MoveItCon
.to_moveit_configs()
)

``MoveItConfigsBuilder`` (`defined here <https://github.com/moveit/moveit2/blob/main/moveit_configs_utils/moveit_configs_utils/moveit_configs_builder.py>`_) can take a few different types of arguments.
Copy link
Contributor

Choose a reason for hiding this comment

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

Note there is already another doc page that talks about this -- maybe cross-link / consider putting some of this there?

https://moveit.picknik.ai/main/doc/how_to_guides/moveit_configuration/moveit_configuration_tutorial.html

``MoveItConfigsBuilder(package_name="package_name")`` will search for a package named "package_name".
``MoveItConfigsBuilder("robot_name")`` will search for an explicitly given package name.
Copy link
Contributor

Choose a reason for hiding this comment

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

might be more readable to have this be a bulleted list

Both arguments can be given, in which case the robot name is stored and the package with the explicitly given name will be loaded.
As seen above, ``gen3`` is the robot name, and MoveIt looks for the package ``kinova_gen3_7dof_robotiq_2f_85_moveit_config`` instead of ``gen3_moveit_config``.

``.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.



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.

.. code-block:: python

Expand Down Expand Up @@ -187,6 +221,7 @@ In our example, we have:
arguments=["robotiq_gripper_controller", "-c", "/controller_manager"],
)


Launching all the nodes
-----------------------

Expand All @@ -213,3 +248,23 @@ Finally, we can tell our launch file to actually launch everything we described
hand_controller_spawner,
]
)

Launching a custom .cpp file
----------------------------

While not part of the Getting Started tutorial, another common node to launch is one that executes a custom .cpp file:
Copy link
Contributor

@sea-bass sea-bass Jan 20, 2025

Choose a reason for hiding this comment

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

A custom .cpp file doesn't sound technically precise -- I think what you may want to say is "a custom executable".

Also, this in isolation may not be entirely helpful if you also don't show a CMakeLists.txt snippet showing how to actually compile this executable.

But generally, there are other tutorials like https://moveit.picknik.ai/main/doc/tutorials/your_first_project/your_first_project.html which already cover this in full detail.


.. code-block:: python

moveit_cpp_node = Node(
name="custom_program",
package="custom_program_package",
executable="custom_program",
output="screen",
parameters=[your,
parameters,
here],
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't consider this too helpful because I always forget what the actual format of the parameters is -- it's a list of dictionaries or something? So I may consider using a real, valid input here instead of placeholder text.

)

where ``moveit_cpp_node_parameters`` is a list of parameters for that node. See Ros2 documentation for more information on launching .cpp files.
Additionally, the tutorials on this site provide more examples on how to create programs to customize MoveIt's capabilities for your project.
Loading