Skip to content

SergioBrodesco/FdR-groupW

Repository files navigation

Fondamenti di Robotica - Gruppo W

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.

Alt text


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


How to use


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

Yolov5 model


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


Modify image_processor.py


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:

path_to_model = "/home/luca/Desktop/yolo5_training/yolov5"

copy the absolute path to your weights here:
path_to_weights = '/home/luca/Desktop/yolo5_training/yolov5/epoch10.pt'

and finally the absolute path to the 3D mesh that you've already downloaded with the repo (located in /scripts/models)
path_to_meshes = "/home/luca/ros_ws/src/locosim/robot_control/lab_exercises/lab_group_w/scripts/models"

now recompile

cd ~/ros_ws
catkin_make install

everything should be set properly


Testing

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

https://github.com/mfocchi/robot_control/blob/25569e7ad103d58ae0b6095f7ccd570975b36218/lab_exercises/lab_palopoli/ur5_generic.py#L75


If you want to use the simulated robot on gazebo, you need to set the real_robot flag as False at this line:


https://github.com/mfocchi/robot_control/blob/25569e7ad103d58ae0b6095f7ccd570975b36218/lab_exercises/lab_palopoli/params.py#LL42C44-L42C44


You can also change between the soft and rigid gripper by modifiyng the soft_gripper flag:


https://github.com/mfocchi/robot_control/blob/25569e7ad103d58ae0b6095f7ccd570975b36218/lab_exercises/lab_palopoli/params.py#LL45C9-L45C9


Note that in order to use the gripper in simulation you also need to set gripper_sim as True at this line:


https://github.com/mfocchi/robot_control/blob/25569e7ad103d58ae0b6095f7ccd570975b36218/lab_exercises/lab_palopoli/params.py#LL44C15-L44C15


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!



Credits

  • 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]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •