Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Commit

Permalink
change name of Caller to FrankaControl
Browse files Browse the repository at this point in the history
  • Loading branch information
nebbles committed Feb 13, 2018
1 parent d8221b9 commit acf7a0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
18 changes: 9 additions & 9 deletions docs/source/operating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,25 @@ These binaries can now be used from the command line to control the Arm::

Alternatively, you can control the Arm using the easy custom Python class ``Caller`` (see below).

Python-Franka API with ``caller.py``
------------------------------------
Python-Franka API with ``franka_control.py``
--------------------------------------------

The Python-FRANKA module (``caller.py``) is designed to allow easy access to the C++ controller programs provided by Petar. The provided Python module, ``caller.py`` is structured as follows.
The Python-FRANKA module (``franka_control.py``) is designed to allow easy access to the C++ controller programs provided by Petar. The provided Python module is structured as follows.

.. automodule:: franka.caller
.. automodule:: franka.franka_control
:members:
:undoc-members:

Example
~~~~~~~

To use the ``Caller`` class in your own Python script would look something like this:
To use the ``FrankaControl`` class in your own Python script would look something like this:

.. code-block:: python
from franka.caller import Caller
from franka.franka_control import FrankaControl
arm = Caller(debug_flag=True)
arm = FrankaControl(debug_flag=True)
# we set the flag true to get prints to the console about what Caller is doing
arm.move_relative(dx=0.1, dy=0.0, dz=-0.3)
Expand All @@ -123,7 +123,7 @@ The structure of the project is important to ensure that importing between modul
│   └── source
├── franka
│   ├── __init__.py
│   ├── caller.py
│   ├── franka_control.py
│   ├── franka_get_current_position
│   ├── franka_get_current_position.cpp
│   ├── franka_move_to_absolute
Expand All @@ -135,7 +135,7 @@ The structure of the project is important to ensure that importing between modul
│   ├── module2.py
│   ├── module3.py
│   ├── __init__.py
└── test_module.py
└── test_script.py


.. Planned method
Expand Down
5 changes: 2 additions & 3 deletions franka/caller.py → franka/franka_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os


class Caller:
class FrankaControl:
"""Class containing methods to control an instance of the Franka Arm.
Will print debug information to the console when ``debug_flag=True`` argument is used. Class
Expand All @@ -19,7 +19,6 @@ def __init__(self, ip='192.168.0.88', debug_flag=False):
self.debug = debug_flag
self.path = os.path.dirname(os.path.realpath(__file__)) # gets working dir of this file


def move_relative(self, dx: float=0.0, dy: float=0.0, dz: float=0.0):
"""Moves Franka Arm relative to its current position.
Expand Down Expand Up @@ -128,7 +127,7 @@ def main():
print("Invalid input. Must be 0/1.")

if testing:
arm = Caller(debug_flag=True)
arm = FrankaControl(debug_flag=True)

if direction == '0':
arm.move_relative(dx=0.05)
Expand Down
4 changes: 2 additions & 2 deletions test_motion.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from motion import Trajectory
from franka.caller import Caller
from franka.franka_control import FrankaControl

vector_list = Trajectory.get_test_trajectory()

Expand All @@ -12,7 +12,7 @@

print("New vectors (mm converted to m): ", new_vectors)

arm = Caller(debug_flag=True)
arm = FrankaControl(debug_flag=True)
for move in new_vectors:
x = move[0]
y = move[1]
Expand Down

0 comments on commit acf7a0e

Please sign in to comment.