This repository includes the traduction of C++ to Python library (Driver motors)
The HUMASOFT project at the time, developed C++ libraries for the movement of Cia402 type engine drivers via CAN communication and a library for the management of IMU type sensors in soft robotics. REPO: https://github.com/HUMASoft. Now HUMASOFT becomes the SOFIA project, which takes a specific target on how to apply machine learning to soft robotic articulations. That's why these C++ libraries were translated to Python using SWIG.
sudo apt-get install can-utils
# verify your Python version
python3 --version
# execute Python in terminal
python3
- Lastly, you will need to configure the environment variable LD_LIBRARY_PATH:
# edit the bashrc file
nano .bashrc
export LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages:$LD_LIBRARY_PATH
- After that type Ctrl+O, then Ctrl+X and in terminal the following:
# loading the .bashrc
source .bashrc
You do not need to do anything for the installation, other than run a script where all the packages that are needed will be installed at the time the script is run.
- Clone the repo in your home folder
- Go to the "CiA402DevicePython" folder, open a terminal there and type:
# giving the permissions to the script to be executed
sudo chmod +x scriptSwig.sh
# execute the script
sh scriptSwig.sh
- Verify that the modules have been installed
# execute Python on terminal
python3
# import PortBase or SocketCanPort modules (for example)
>>> import PortBase
>>> import SocketCanPort
VScode has been used and worked with this library without problems.
Now you can start using the library in Python