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

merging dev into suturo branch #36

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0f625b0
[intro-example] fixing typos, adding info
hawkina Jan 2, 2024
f3bcae7
[designator] refactored action_designator
davidprueser Jan 5, 2024
8d11a5d
[orm] fixed orm querying
davidprueser Jan 5, 2024
6f90a47
[tests] updated orm tests
davidprueser Jan 5, 2024
c4d6122
Merge branch 'dev' into tests
davidprueser Jan 5, 2024
af9e3e6
[tests] fixed object designator test
davidprueser Jan 5, 2024
dce2b77
[doc] added language example to doc
Tigul Jan 13, 2024
bd41a55
[examples] fixing typos
hawkina Jan 17, 2024
b2c2f5d
Add explanation to virtualenv and pycharm setup
artnie Jan 17, 2024
04d2105
Fixes an error where only the first test would be sucessful
Leusmann Jan 18, 2024
58a6121
[submodule] deleted submodule macropy, since it is no longer used due…
sunava Jan 18, 2024
cbfaa47
Merge pull request #127 from hawkina/minor
sunava Jan 18, 2024
b1f2a35
[designator] removed MotionDesignatorDescription
davidprueser Jan 18, 2024
74ea1aa
Merge pull request #131 from sunava/deleted-macropy-sub
Tigul Jan 19, 2024
01d01b1
Merge branch 'dev' into tests
davidprueser Jan 19, 2024
7520c8a
merge dev into tests
davidprueser Jan 19, 2024
51f8891
Update README.md, deleted Authors
sunava Jan 19, 2024
b499e78
[bullet reasoning] Fixed wrong robot usage
Tigul Jan 19, 2024
6c0fdea
Merge pull request #130 from Leusmann/bugfix-database-merger
Tigul Jan 22, 2024
95fcdac
[Bullet World] Increse world sync frequency
Tigul Jan 22, 2024
3fc7046
[general] maintenance
Tigul Jan 22, 2024
e1c84c1
[ci] fixed failing ci
Tigul Jan 22, 2024
5833a9d
[test] updated orm querying; added docstrings to actions and motions
davidprueser Jan 22, 2024
4081685
[test] fixed an issue where the orm session was not properly clossed …
davidprueser Jan 22, 2024
3054f5e
[doc] Remove ipython install
artnie Jan 26, 2024
f6dd146
[test] fixed orm test inheritance pattern
davidprueser Jan 26, 2024
d3eb6ef
Merge pull request #128 from artnie/doc-pycharm-setup
Tigul Jan 26, 2024
5e32afd
[designator] removed deprecated motions
davidprueser Jan 29, 2024
c9328d5
[doc] updated orm querying, motions and actions in documentation
davidprueser Feb 1, 2024
b03c6e2
[orm] fixed sqlalchemy deprecation warnings
davidprueser Feb 1, 2024
15225f1
Merge pull request #123 from davidprueser/tests
Tigul Feb 5, 2024
00ea8c4
[doc] fixed failing doc
Tigul Feb 5, 2024
a0003a8
[tests] fixed deprecation warnings
Tigul Feb 5, 2024
ff0295d
[examples] added local transfomer to sphinx and new sym link
Tigul Feb 7, 2024
4ebee7f
[doc] actually added new sym link
Tigul Feb 7, 2024
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
8 changes: 4 additions & 4 deletions .github/workflows/pycram-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ jobs:
catkin_make
echo 'export ROS_HOSTNAME=localhost' >> ~/.bashrc
echo 'source $GITHUB_WORKSPACE/ros_ws/devel/setup.bash' >> ~/.bashrc
- name: Upgrade pip
run: |
sudo pip3 install --upgrade pip
- name: Install requirements
run: |
cd $GITHUB_WORKSPACE/ros_ws/src/pycram
sudo pip3 install -r requirements.txt
- name: upgrade numpy
run: |
sudo pip3 install --upgrade numpy
- name: install additional requirements
run: |
sudo pip3 install pytest pyjpt mlflow
sudo pip3 install --ignore-installed pytest pyjpt mlflow
- name: start roscore
run: |
roslaunch pycram ik_and_description.launch &
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/reusable-sphinx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- dev
pull_request:
branches:
- master
- dev

# ----------------------------------------------------------------------------------------------------------------------

Expand Down
4 changes: 1 addition & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[submodule "src/neem_interface_python"]
path = src/neem_interface_python
url = https://github.com/Tigul/neem_interface_python
[submodule "src/macropy"]
path = src/macropy
url = https://github.com/Tigul/macropy.git

9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,3 @@ how to do that take a look at the respective `README` file.
If you encounter some error please first take a look at the
[troubleshooting](https://pycram.readthedocs.io/en/latest/troubleshooting.html) section and see if the error is mentioned
there.

## Authors

* **Jonas Dech** <[email protected]>
* **Andy Augsten** <[email protected]>
* **Dustin Augsten** <[email protected]>
* **Christopher Pollok** <[email protected]>
* **Thomas Lipps** <[email protected]>
* **Benjamin Alt** <[email protected]>
2 changes: 1 addition & 1 deletion doc/source/designators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ action looks like this:

.. code-block:: python

NavigateAction.Action(robot_position=((0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0)), target_location=[[1, 0, 0], [0, 0, 0, 1]])
NavigateActionPerformable(robot_position=((0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0)), target_location=[[1, 0, 0], [0, 0, 0, 1]])


A visual representation of the whole idea of designator and designator descriptions can be
Expand Down
6 changes: 4 additions & 2 deletions doc/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ Misc
notebooks/minimal_task_tree
notebooks/pose
notebooks/custom_resolver
notebooks/language
notebooks/local_transformer

Interface Examples
==================

.. nbgallery::
notebooks/giskard
notebooks/robokudo
notebooks/interface_examples/giskard
notebooks/interface_examples/robokudo

Object Relational Mapping
=========================
Expand Down
48 changes: 33 additions & 15 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,48 @@ The code for this plan can be seen below.

.. code-block:: python

@with_simulated_robot
def plan():
MotionDesignator(MoveArmJointsMotionDescription(left_arm_config='park',
right_arm_config='park')).perform()
from pycram.bullet_world import BulletWorld, Object
from pycram.process_module import simulated_robot
from pycram.designators.motion_designator import *
from pycram.designators.location_designator import *
from pycram.designators.action_designator import *
from pycram.designators.object_designator import *
from pycram.enums import ObjectType

MotionDesignator(MoveMotionDescription(target=moving_targets[robot_name]["sink"][0],
orientation=moving_targets[robot_name]["sink"][1])).perform()
world = BulletWorld()
kitchen = Object("kitchen", ObjectType.ENVIRONMENT, "kitchen.urdf")
robot = Object("pr2", ObjectType.ROBOT, "pr2.urdf")
cereal = Object("cereal", ObjectType.BREAKFAST_CEREAL, "breakfast_cereal.stl", position=[1.4, 1, 0.95])

det_obj = MotionDesignator(DetectingMotionDescription(object_type="milk")).perform()
cereal_desig = ObjectDesignatorDescription(names=["cereal"])
kitchen_desig = ObjectDesignatorDescription(names=["kitchen"])
robot_desig = ObjectDesignatorDescription(names=["pr2"]).resolve()

MotionDesignator(PickUpMotionDescription(object=milk, arm="left", grasp="front")).perform()
with simulated_robot:
ParkArmsAction([Arms.BOTH]).resolve().perform()

MoveTorsoAction([0.3]).resolve().perform()

MotionDesignator(MoveMotionDescription(target=moving_targets[robot_name]["island"][0],
orientation=moving_targets[robot_name]["island"][1])).perform()
pickup_pose = CostmapLocation(target=cereal_desig.resolve(), reachable_for=robot_desig).resolve()
pickup_arm = pickup_pose.reachable_arms[0]

MotionDesignator(PlaceMotionDescription(object=milk, target=[-0.9, 1, 0.93], arm="left")).perform()
NavigateAction(target_locations=[pickup_pose.pose]).resolve().perform()

MotionDesignator(MoveArmJointsMotionDescription(left_arm_config='park',
right_arm_config='park')).perform()
PickUpAction(object_designator_description=cereal_desig, arms=[pickup_arm], grasps=["front"]).resolve().perform()

MotionDesignator(MoveMotionDescription(target=[0.0, 0.0, 0],
orientation=[0, 0, 0, 1])).perform()
ParkArmsAction([Arms.BOTH]).resolve().perform()

place_island = SemanticCostmapLocation("kitchen_island_surface", kitchen_desig.resolve(), cereal_desig.resolve()).resolve()

place_stand = CostmapLocation(place_island.pose, reachable_for=robot_desig, reachable_arm=pickup_arm).resolve()

NavigateAction(target_locations=[place_stand.pose]).resolve().perform()

PlaceAction(cereal_desig, target_locations=[place_island.pose], arms=[pickup_arm]).resolve().perform()

ParkArmsAction([Arms.BOTH]).resolve().perform()

world.exit()

Tutorials
---------
Expand Down
60 changes: 52 additions & 8 deletions doc/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Then install the Python packages in the requirements.txt file

Building your ROS workspace
===========================
.. _build-ws:

Building and sourcing your ROS workspace using catkin compiles all ROS packages and manages the appending to the
respective PATH variables. This is necessary to be able to import PyCRAM via the Python import system and to find the
Expand Down Expand Up @@ -160,6 +161,7 @@ After installing pandoc, install sphinx on your device.

sudo apt install python3-sphinx


Install the requirements in your python interpreter.

.. code-block:: shell
Expand All @@ -180,27 +182,67 @@ Show the index.
firefox build/html/index.html



Setting up PyCRAM with PyCharm
==============================

Setting up PyCharm with packages that rely on rospy is non trivial. Follow this guide to get correct syntax highlighting
for the PyCRAM project.
Setting up PyCharm with packages that rely on rospy is non trivial. Follow this guide to get correct syntax highlighting for the PyCRAM project.

Install PyCharm Professional
----------------------------

First, `install PyCharm Professional <https://www.jetbrains.com/help/pycharm/installation-guide.html#standalone>`_.

Next, if you have virtual environments that you want to use, you need to make sure that they have rospy available.
If you create a new environment, make sure to include `--system-site-packages` in your creation command.
You can check by activating your environment and calling the import
Create a JetBrains account and verify it for educational purpose. Now you can unlock the PyCharm Professional features in PyCharm.

The next step will set up the virtual Python environment, so it can be used as a project interpreter in PyCharm.


Set up virtualenv
-----------------
.. _virtualenv:

The virtualenvwrapper allows to manage virtual Python environments, where additional packages can be installed without the risk of breaking the system-wide Python configuration. Install `virtualenvwrapper <https://virtualenvwrapper.readthedocs.io/en/latest/>`_ via pip and set it up.

.. code-block:: shell

sudo pip3 install virtualenvwrapper
echo "export WORKON_HOME=~/envs" >> ~/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
mkdir -p $WORKON_HOME
source ~/.bashrc

Create a virtual env based on the workspaces libraries (see build-ws_) and add the `--system-site-packages` to get them properly. The env will be registered in `$WORKON_HOME`.

.. code-block:: shell

source ~/workspace/ros/devel/setup.bash
mkvirtualenv pycram --system-site-packages
ls $WORKON_HOME


Check if the ROS libraries are available in the virtual env.

.. code-block:: shell

workon your_env
workon pycram
python -c "import rospy"

If it complains about `python`, install the following, to set `python` to Python 3 by default.

.. code-block:: shell

sudo apt install python-is-python3

If it finds `python` but complains about missing packages, make sure that the workspace is sourced before creating the virtual env. Also remember to create the virtual env with the `--system-site-packages` flag.

If this returns no errors, you can be sure that rospy is usable in your virtual environment. Next you have to build the
ros workspace including pycram and source it as described in install-pycram_.
ros workspace including pycram and source it as described in build-ws_.

Configure PyCharm
-----------------

After that you have to start PyCharm from the terminal via
Always start PyCharm from the terminal via

.. code-block:: shell

Expand All @@ -212,6 +254,7 @@ or

~/pycharm/bin/pycharm.sh


Select **File | Open** and select the root folder of the PyCRAM package.
Next go to **File | Settings | Project: pycram | Python Interpreter** and set up your virtual environment with rospy and
the sourced workspace available as the python interpreter.
Expand All @@ -221,6 +264,7 @@ folder as Tests and the resources as Resources.

To verify that it works, you can execute any Testcase.


Using IPython as REPL
=====================

Expand Down
1 change: 1 addition & 0 deletions doc/source/notebooks
1 change: 0 additions & 1 deletion doc/source/notebooks/action_designator.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/bullet_world.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/custom_resolver.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/giskard.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/intro.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/location_designator.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/migrate_neems.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/minimal_task_tree.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/motion_designator.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/object_designator.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/orm_example.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/orm_querying_examples.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/pose.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/robokudo.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/thumbnails/action_designator.png

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/thumbnails/bullet_world.png

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/thumbnails/default.png

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/thumbnails/location_designator.png

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/thumbnails/motion_designator.png

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/thumbnails/object_designator.png

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/thumbnails/overview.png

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/thumbnails/pose.png

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/notebooks/thumbnails/tree.png

This file was deleted.

18 changes: 9 additions & 9 deletions examples/action_designator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"metadata": {},
"source": [
"# Action Designator\n",
"This example will show the different kinds of Action Designator that are available. We will see how to create Action Designators and what they do.\n",
"This example will show the different kinds of Action Designators that are available. We will see how to create Action Designators and what they do.\n",
"\n",
"\n",
"Action Designator are high-level descriptions of actions which the robot should execute. \n",
"Action Designators are high-level descriptions of actions which the robot should execute. \n",
"\n",
"Action Deisgnators are created from a Action Designator Descritpion, which describes the type of action as well as the parameter for this action. Parameter are given as a list of possible parameters.\n",
"Action Designators are created from an Action Designator Description, which describes the type of action as well as the parameter for this action. Parameter are given as a list of possible parameters.\n",
"For example, if you want to describe the robot moving to a table you would need a ```NavigateAction``` and a list of poses that are near the table. The Action Designator Description will then pick one of the poses and return a performable Action Designator which contains the picked pose. \n",
"\n"
]
Expand Down Expand Up @@ -103,7 +103,7 @@
"id": "30bd6765",
"metadata": {},
"source": [
"What we now did was create the pose were we want to move the robot, create a description describing a navigation with a list of possible poses (in this case the list contains only one pose) and create an action designator from the description. The action designator contains the pose picked from the list of possible poses and can be performed."
"What we now did was: create the pose where we want to move the robot, create a description describing a navigation with a list of possible poses (in this case the list contains only one pose) and create an action designator from the description. The action designator contains the pose picked from the list of possible poses and can be performed."
]
},
{
Expand All @@ -126,7 +126,7 @@
"source": [
"Every designator that is performed needs to be in an environment that specifies where to perform the designator either on the real robot or the simulated one. This environment is called ```simulated_robot``` similar there is also a ```real_robot``` environment. \n",
"\n",
"There are also decorators which do the same thing but for whole methods, they are called ```with_real_robot``` and ```with_simulated_robor```"
"There are also decorators which do the same thing but for whole methods, they are called ```with_real_robot``` and ```with_simulated_robot```."
]
},
{
Expand All @@ -137,7 +137,7 @@
"## Move Torso\n",
"This action designator moves the torso up or down, specifically it sets the torso joint to a given value.\n",
"\n",
"We start again by creating a description and resolving it to a designator. Afterwards, the designator is perfomed in a ```simulated_robot``` environment. "
"We start again by creating a description and resolving it to a designator. Afterwards, the designator is performed in a ```simulated_robot``` environment. "
]
},
{
Expand Down Expand Up @@ -216,9 +216,9 @@
"metadata": {},
"source": [
"## Pick Up and Place\n",
"Since these are depending on each other, meaning you can only place something when you picked it up beforehand, they will be shown together. \n",
"Since these two are dependent on each other, meaning you can only place something when you picked it up beforehand, they will be shown together. \n",
"\n",
"These action designators use object designators, which will not be further explained so please check the example on object designators for more details. \n",
"These action designators use object designators, which will not be further explained in this tutorial so please check the example on object designators for more details. \n",
"\n",
"To start we need an environment in which we can pick up and place things as well as an object to pick up."
]
Expand Down Expand Up @@ -552,7 +552,7 @@
"metadata": {},
"source": [
"## Transporting\n",
"Transporting can transport an object from its current position to another target position. It is similar to the Pick and Place plan used in the Pick-up and Place example. Since we need an Object which we can transport we spawn a milk, you don't need to do this if you alredy spawned it in a previous example."
"Transporting can transport an object from its current position to another target position. It is similar to the Pick and Place plan used in the Pick-up and Place example. Since we need an Object which we can transport we spawn a milk, you don't need to do this if you already have spawned it in a previous example."
]
},
{
Expand Down
Loading
Loading