- If you haven't created a catkin_workspace, do so
cd ~
mkdir your_ws
cd your_ws
mkdir src
- Download the packages in the src folder
cd ~
git clone https://github.com/roboticslab-uc3m/roboespas
- Modify .bashrc to use this workspace and set the ROS_IP and ROS_WORKSPACE env variables. Change the IP for your IP (check it using
ifconfig
).
export ROS_WORKSPACE=~/your_ws #edit for your workspace
export ROS_MASTER_URI=http://192.168.1.53:11311 #edit for your IP
export ROS_IP=192.168.1.53 #edit for your IP
- Compile the workspace
roscd
cd src/
catkin_make
- Re-generate messages (jump to 3 if you have not generate matlab messages before)
- Delete previously created messages. In Matlab prompt
rosgenmsg('/home/user/your_ws/src/roboespas')
Open javaclasspath.txt
file that you are linked and delete all the content.
Delete /home/user/your_ws/src/roboespas/matlab_gen
folder.
-
Restart Matlab
-
Generate messages
rosgenmsg('/home/user/your_ws/src/roboespas')
Follow the instructions (add to javaclasspath.txt the files given, and add to path the folder) 4. Restart Matlab.
This way Matlab will send joint torque values point by point.
-
Execute in a terminal:
roslaunch iiwa_command iiwa_command_gazebo.launch
. Although you won't use iiwa_command action server, you need to use the launcher to load config parameters. -
In Matlab, modify the IP in the file
TorqueControlExample.m
(lines 6-7) inside theTorqueControlExample
folder, then play the script and watch IIWA in Gazebo simulator moving.
This way Matlab will send joint torque values all together as a trajectory.
-
Execute in a terminal:
roslaunch iiwa_command iiwa_command_gazebo.launch
. -
In Matlab, modify the IP in the file
TrajectoryTorqueControlExample.m
(lines 6-7) inside theTorqueControlExample
folder, then play the script and watch IIWA in Gazebo simulator moving.
https://drive.google.com/drive/folders/1mvBHLigwaf9ykC70j0tyhNbo1mdIiZAx