This repository contains all the sources created by the group W during the course "Fondamenti di Robotica", that took place during the accademic year 2022/2023 in University of Trento.
Open Project-1_Robot-Robotic_Manipulator.pdf to have more details about the project.
If you want to read the Doxygen Documentation for the code, check the generated PDF doc here.
Alternatively, you can find the html version of the documentation after completing the setup explained here.
To view the html page, you need to open the index.html file inside the FdR-groupW/docs/html folder
cd LOCOSIM_DIR/robot_control/lab_exercises/FdR-groupW/docs/html
xdg-open index.html
The repo consist of a ROS 1 package that needs to be integrated with the Locosim repo, so first follow the instructions provided in the Locosim repo.
NOTE: You should change LOCOSIM_DIR with the path to your /locosim directory.
We also assume that your /ros_ws folder is located in your home folder.
Then download our package in the /lab_exercise folder:
cd LOCOSIM_DIR/robot_control/lab_exercises
git clone https://github.com/SergioBrodesco/FdR-groupW.git
Some files need to be included in the Locosim environment, so first go in the locosim_addOns folder and copy all the mesh and custom material files
cd locosim_addOns/models
cp -r * LOCOSIM_DIR/ros_impedance_controller/worlds/models
copy also the custom world files
cd ../worlds
cp * LOCOSIM_DIR/ros_impedance_controller/worlds
compile and update the packages list
cd ~/ros_ws
catkin_make install
source ~/.bashrc
What we still miss is a local model of Yolov5 and a set of trained weights...
To download the yolov5 model you just need to follow the Ultralytics guidelines
cd LOCOSIM_DIR/robot_control/lab_exercises/FdR-groupW/scripts
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
if you have a local set of weigths you can copy it in the /scripts folder as well
some code lines of /scripts/image_processr.py containing absolute paths to your yolov5 model, mesh files and weights need to be modified in order to work properly...
copy the absolute path to your model here:
FdR-groupW/scripts/image_processor.py
Line 534 in 849b341
copy the absolute path to your weights here:
FdR-groupW/scripts/image_processor.py
Line 535 in 849b341
and finally the absolute path to the 3D mesh that you've already downloaded with the repo (located in /scripts/models)
FdR-groupW/scripts/image_processor.py
Line 540 in 849b341
now recompile
cd ~/ros_ws
catkin_make install
everything should be set properly
First you need to change the world file with one of your choice... we suggest to start with "my_world.world", to do that edit /ur5_generic.py at the following line, and specify '<your_world_name.world>' instead
If you want to use the simulated robot on gazebo, you need to set the real_robot flag as False at this line:
You can also change between the soft and rigid gripper by modifiyng the soft_gripper flag:
Note that in order to use the gripper in simulation you also need to set gripper_sim as True at this line:
To run the simulation first open a new terminal and run the /ur5_generic.py script, this will initialize all the basic nodes and the Gazebo enviroment
cd LOCOSIM_DIR/robot_control/lab_exercises/lab_palopoli
python3 -i ur5_generic.py
Otherwise you can also run the ur5_generic.py script using the pycharm IDE if you have it installed and working for locosim.
After the Homing procedure of the robotic arm is accomplished run our 3 custom nodes, each in a separate terminal
rosrun lab_group_w motion_processor
rosrun lab_group_w task_planner
rosrun lab_group_w image_processor
That's it! You should see the simulation running!
-
Luca Cazzola - Università degli studi di Trento (Unitn), Trento – Italy
[email protected] -
Dennis Cattoni - Università degli studi di Trento (Unitn), Trento – Italy
[email protected] -
Sergio Brodesco - Università degli studi di Trento (Unitn), Trento – Italy
[email protected]