• Stars
    star
    175
  • Rank 218,059 (Top 5 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created almost 11 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DEPRECATED use https://github.com/victorlei/smop instead LiberMate - A MATLAB to Python (SciPy/NumPy) Translator

DEPRECATED

Use https://github.com/victorlei/smop instead.

libermate

LiberMate - A MATLAB to Python (SciPy/NumPy) Translator

All credit goes to Eric C. Schug for this incredible work.

Check notes_on_using_libermate.txt if you use it and it doesn't work properly (it's normal!) I give many hints there on how to correct problems I had while translating https://github.com/awesomebytes/parametric_modeling

You may want to try the new: https://github.com/victorlei/smop It's a work in progress, which means, someone is working on it! This one is just as it is.

=========

(Almost) Original README from http://sourceforge.net/p/libermate/code/HEAD/tree/

=== LiberMate ===

LiberMate - A MATLAB to Python (SciPy/NumPy) Translator

git clone https://github.com/awesomebytes/libermate.git

===Setup===

Libermate needs pyclips http://pyclips.sourceforge.net/web/ --> http://sourceforge.net/projects/pyclips/files/pyclips/pyclips-1.0/

Download pyclips-1.0.7.348.tar.gz

Extract and install (there is a README if you have doubts)

tar -zxvf pyclips-1.0.7.348.tar.gz
cd pyclibs
sudo python setup.py build
sudo python setup.py install

===Run===

Change directory to the libermate directorie e.g.

$ cd libermate

To get command line help use

$ python libermate.py -h

To convert a single test file type

$ python libermate.py Tests/colon.m

and will print the following output

Opening File Tests/colon.m
Starting Parser
Parser Complete
Starting Translator
Translation Complete
writing to file Tests/colon.py

To convert all test files type

$ python libermate.py Tests/*.m

To output Abstract Syntax Tree from colon.m

$ python libermate.py --astdump Tests/colon.m

Opening File Tests/colon.m
Starting Parser
Parser Complete
writing to file Tests/colon.ast
Starting Translator
Translation Complete
writing to file Tests/colon.py

This will create a file called Tests/colon.ast which contains the AST for the parsed file. The AST file can be useful to track where the Parser may have had problems.

LiberMate will attempt to convert MATLAB source files to python. The MATLAB files must end with .m and the translated python code will be written to python files, of the same name but ending with .py.

===Known Issues===

  • LiberMate does not handle command style MATLAB expressions such as

    grid on

    instead use function expressions such as

    grid('on')

  • LiberMate does not map all MATLAB functions to SciPy/NumPy equivalents. It does map several common functions.

  • LiberMate does not completely support freeform matrix expressions (e.g.

$ ./libermate.py Tests/matrix_tests.m

Opening File Tests/matrix_tests.m
Starting Parser
syntax error: unexpected symbol at line 10 (column 4): "
 "
syntax error: unexpected symbol at line 11 (column 3): " "
Parser Complete
Starting Translator
error: unexpected end of subtree
Translation Complete
writing to file Tests/matrix_tests.py

The output shows two errors on lines 10 and 11 that are cause by an initial newline and final newline in matrix expression for variable d.

  • numpy does not automatically grow arrays
  • python scalars behave differently from matlab arrays
  • plot title,ylabel do not take extra arguments
  • missing waitbar function

TODO

  • replace a.copy() with copy(a)

More Repositories

1

occupancy_grid_python

A package to ease working with ROS nav_msgs/OccupancyGrids from Python
Python
56
star
2

alienware15r3_ubuntu14

Instructions on how to install Ubuntu 14.04 on the Alienware 15 R3 (and installing cuda, tensorflow and disabling intel graphics card)
Python
56
star
3

ubuntu14_dell_xps13_9350

Instructions to get a dell xps 13 9350 working with wifi with ubuntu 14.04
41
star
4

parametric_modeling

Parametric modelling functions that can be found in MATLAB now in python
Python
41
star
5

rqt_embed_window

rqt_embed_window is a rqt_gui plugin that allows to embed any graphical application as a rqt widget
Python
30
star
6

xenorasp

Raspberry Pi with Xenomai using Ipipe patches
Shell
21
star
7

web_dyn_reconf

Web based dynamic reconfigure for ROS robots
Python
18
star
8

reverse_engineering_MKT_for_fun

Reverse Engineering Mario Kart Tour for fun
Python
17
star
9

pepper_os

Base image for using Pepper (2.5) with ROS Kinetic or Melodic (and much more!)
Dockerfile
16
star
10

dmp_gestures

Gesture learning and execution via DMPs
Python
14
star
11

gentoo_prefix_ci

A Gentoo Prefix continuous integration repo. Find precompiled Gentoo Prefix in the releases section
Shell
14
star
12

python_qt_tutorial

Python
14
star
13

etherdream_tools

A web interface for the etherdream DAC mostly in Python and Javascript using JQuery interfacing with DXF and ILDA files to stream them
Python
13
star
14

gazebo_tests

Python
12
star
15

moveit_grasping_testing

Just a package with lots of files and testing stuff with moveit and grasping related things with REEM
Python
11
star
16

python_profiling_tutorial_with_ros

Notes and test code to exemplify how to profile a python node (which is used in ROS)
Python
10
star
17

delta_robot

delta robot simulator and code to move the dynamixels based model
Python
9
star
18

move_joints_interactive

Package to move all the joints controller by joint_trajectory_controller using Rviz markers on each joint.
Python
8
star
19

gazebo_model_velocity_plugin

Improved ros_planar_move + gazebo_ros_p3d plugin in one
C++
7
star
20

ddynamic_reconfigure

Historical fork for PAL Robotics' ddynamic_reconfigure, please use PAL's released version
C++
7
star
21

python-control-code

Last checkout of the most recent branch of the Python Control Systems Library (python-control) from https://sourceforge.net/p/python-control
Python
6
star
22

look_sound_source

Little demo of using hark_sound_source_localization to look at where the sound came from
Python
5
star
23

mjpeg_stream_tests

A server and a client in python for mjpeg streams for testing
Python
4
star
24

roscpp_to_rospy

CMake
4
star
25

control_toolbox_pid_tutorial

control_toolbox::Pid tutorial / example
C++
4
star
26

turtlebot_laser_work

Creating maps using gmapping and TF with wheel encoder data and laser readings
Python
4
star
27

hist_user_tracking

trying to revive the package hist_user_tracking to test it
C++
4
star
28

ros_overlay_on_gentoo_prefix

ros-overlay built on Gentoo Prefix ready to use
Dockerfile
3
star
29

image_transport_python

Project aims to expose image_transport in Python by wrapping the C++ library with pybind11
C++
3
star
30

opentld_tracked_point_xtion

Visualize, using opentld with ros and an xtion (or kinect actually), the tracked point in rviz
Python
3
star
31

omron_hvc_p_python

Python
3
star
32

ros_overlay_on_gentoo_prefix_32b

ros-overlay built on Gentoo Prefix ready to use (32b)
Dockerfile
3
star
33

python-mlabwrap

A fork of http://code.google.com/p/danapeerlab/ mlabwrap submodule
Python
3
star
34

instagram_mosaic

Python
2
star
35

global_planner

global_planner fork that cleans robot_radius on start of goal
C++
2
star
36

gentoo_prefix_ci_32b

A Gentoo Prefix continuous integration repo (32bits). Find precompiled Gentoo Prefix in the releases section
Shell
2
star
37

my_pkg

ROS Catkin (Hydro) Python example package with creation of Srv and Msg messages
Python
2
star
38

dmp_reem_razer

Capture a motion with a razer hydra, compute it's dmp and generate a trajectory (and execute it) on REEM robot
OpenEdge ABL
2
star
39

shapeoko_leap

Teleoperate your shapeoko CNC with Leap Motion.
Python
1
star
40

trac_ik

C++
1
star
41

reem_rgbd_launch

A package for launching the rgbd sensor used on REEM and REEM-C (Asus Xtion)
Python
1
star
42

temperature_joints_markers

Python
1
star
43

image_transport_py

CMake
1
star
44

aisoy_playground

Python
1
star
45

chessboard_pose

Python
1
star
46

remi_examples

Python
1
star
47

src

temporalbackupplace
C++
1
star
48

image_transport_qoi_playground

Dockerfile
1
star