Skip to content

Commit

Permalink
add README.md instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nibanovic committed Apr 8, 2024
1 parent 87086b5 commit 2b4900b
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/setup-robot-moveit.bash
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ done
prepend_to_string="if(BUILD_TESTING)"
sed -i "s/$prepend_to_string/install\(\\n DIRECTORY config launch rviz srdf\\n DESTINATION share\/\$\{PROJECT_NAME\}\\n\)\\n\\n$prepend_to_string/g" CMakeLists.txt

# TODO: add README with general instructions
# extend README with general instructions
if [ -f README.md ]; then
cat $MOVEIT_TEMPLATES/append_to_README.md >>README.md
sed -i "s/\\\$PKG_NAME\\\$/${PKG_NAME}/g" README.md
sed -i "s/\\\$ROBOT_NAME\\\$/${ROBOT_NAME}/g" README.md
fi

# TODO: Add license checks

Expand Down
15 changes: 15 additions & 0 deletions templates/moveit/append_to_MAIN_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


## Moving the robot using MoveIt2
> **NOTE:** If you are not familiar with MoveIt2, check the docs for some [useful examples](https://moveit.picknik.ai/main/doc/tutorials/getting_started/getting_started.html)
To move the robot using Moveit2, we first bring up the robot with the mock hardware enabled:
```
ros2 launch <robot_bringup_package> $ROBOT_NAME$.launch.xml use_mock_hardware:=true
```

After that, in another terminal we launch MoveIt2:
```
ros2 launch $ROBOT_NAME$_moveit moveit.launch.xml
```
Now we can use the `MotionPlanning` widget in `rviz2` to assign goals, plan and execute motions.
44 changes: 44 additions & 0 deletions templates/moveit/append_to_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@


## General details about robot MoveIt2 packages

A moveit package holds config and launch files for robotic manipulation using MoveIt2.
It builds on description and bringup packages generated by `setup-robot-description` and `setup-robot-bringup`.

The general package structure is the following:

```
$PKG_NAME$/ # Launch and config files for robot manipulation using MoveIt
├── [CMakeLists.txt] # if ament_cmake is used (recommended)
├── package.xml
├── [setup.py] # if ament_python is used
├── [setup.cfg] # if ament_python is used
├── config/
│ ├── move_group.yaml # Various configuration needed for move_group_node: controllers, kinematics, action execution...
│ ├── <planner>_planning.yaml # Specific planner configuration. Default is OMPL
└── launch/
├── moveit.launch.py # MoveIt launch file.
└── srdf/
├── $ROBOT_NAME$_macro.srdf.xacro # Semantic robot description macro
├── $ROBOT_NAME$.srdf.xacro # Semantic robot description required for MoveIt.
└── rviz/
├── moveit.launch.py # RViZ config with MoveIt MotionPlanning widget.
```
## Compiling the package

To sucessfuly compile and run this package, it is necessary to install `MoveIt`. For a simple binary install, [follow the official guide](https://moveit.ros.org/install-moveit2/binary/)

## Moving the *mock_robot* using MoveIt2

1. Start robot's hardware and load controllers (default configuration starts mock hardware)
```
ros2 launch <bringup_pkg_name> $ROBOT_NAME$.launch.xml
```

2. Open another terminal and launch MoveIt
```
ros2 launch $ROBOT_NAME$_moveit moveit.launch.xml
```

3. You should now be able to use `MotionPlanning` widget in `rviz2` to assign, plan and execute robot motion.

0 comments on commit 2b4900b

Please sign in to comment.