├── figs
├── zed_camera.pdf
├── network_settings.pdf
├── go1_setup.md
├── utils.md
└── zed_calibration.md
├── robot_descriptions
└── gazebo_plugins
│ ├── set_damping_plugin
│ ├── srv
│ │ └── SetFloat.srv
│ ├── package.xml
│ ├── CMakeLists.txt
│ └── src
│ │ └── dynamic_joint_damping_plugin.cpp
│ └── set_mass_plugin
│ ├── CMakeLists.txt
│ ├── src
│ └── SetMassPlugin.cpp
│ └── package.xml
├── locosim.bib
├── robot_urdf
├── ur4.srdf
├── ur5.srdf
├── simple_geometry.urdf
├── ur4_2links.urdf
├── double_pendulum.urdf
├── hyq.srdf
├── solo.srdf
├── ur4.urdf
├── jumpleg.urdf
├── ur5.urdf
├── climbingrobot.urdf
└── hyq.urdf
├── install_docker_windows.md
├── network_settings.md
├── docker
├── install_docker.sh
└── Dockerfile
├── .gitmodules
├── loco-install.sh
├── install_docker_linux.md
├── install_docker_mac.md
├── install_native.md
└── Readme.md
/figs/zed_camera.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idra-lab/locosim/HEAD/figs/zed_camera.pdf
--------------------------------------------------------------------------------
/figs/network_settings.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idra-lab/locosim/HEAD/figs/network_settings.pdf
--------------------------------------------------------------------------------
/robot_descriptions/gazebo_plugins/set_damping_plugin/srv/SetFloat.srv:
--------------------------------------------------------------------------------
1 | # Request: float64 value
2 | float64 value
3 |
4 | ---
5 | # Response: bool success
6 | bool success
7 |
--------------------------------------------------------------------------------
/locosim.bib:
--------------------------------------------------------------------------------
1 | @INPROCEEDINGS{focchi23clawar,
2 | author = {Focchi, Michele and Roscia, Francesco and Semini, Claudio},
3 | title = {Locosim: an Open-Source Cross-PlatformRobotics Framework},
4 | booktitle={Synergetic Cooperation between Robots and Humans. CLAWAR 2023. Lecture Notes in Networks and Systems},
5 | year = {2024},
6 | pages={395--406},
7 | doi = {10.1007/978-3-031-47272-5_33}
8 | }
9 |
--------------------------------------------------------------------------------
/robot_descriptions/gazebo_plugins/set_mass_plugin/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0.2)
2 | project(set_mass_plugin)
3 |
4 | find_package(catkin REQUIRED COMPONENTS roscpp gazebo_ros gazebo_msgs)
5 |
6 | find_package(gazebo REQUIRED)
7 | include_directories(${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS})
8 | link_directories(${GAZEBO_LIBRARY_DIRS})
9 |
10 | add_library(set_mass_plugin SHARED src/SetMassPlugin.cpp)
11 | target_link_libraries(set_mass_plugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
12 |
13 |
14 | install(TARGETS set_mass_plugin DESTINATION $ENV{LOCOSIM_DIR}/robot_descriptions/gazebo_plugins/lib)
15 |
--------------------------------------------------------------------------------
/robot_descriptions/gazebo_plugins/set_damping_plugin/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | set_damping_plugin
4 | 0.0.0
5 | The set_damping_plugin package
6 |
7 | mfocchi
8 | TODO
9 |
10 |
11 | catkin
12 | gazebo_ros
13 | std_msgs
14 | roscpp
15 | gazebo_ros
16 | roscpp
17 | gazebo_ros
18 | roscpp
19 | std_msgs
20 | message_generation
21 | message_runtime
22 |
23 |
24 |
--------------------------------------------------------------------------------
/robot_descriptions/gazebo_plugins/set_damping_plugin/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0)
2 | project(set_damping_plugin)
3 |
4 | find_package(Gazebo REQUIRED)
5 | find_package(catkin REQUIRED COMPONENTS
6 | roscpp
7 | std_msgs
8 | gazebo_ros
9 | message_generation
10 | )
11 |
12 | add_service_files(
13 | FILES
14 | SetFloat.srv
15 | )
16 |
17 | generate_messages(
18 | DEPENDENCIES
19 | std_msgs
20 | )
21 |
22 | catkin_package(
23 | CATKIN_DEPENDS std_msgs message_runtime
24 | )
25 |
26 |
27 | include_directories(${GAZEBO_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
28 |
29 | add_library(set_damping_plugin SHARED src/dynamic_joint_damping_plugin.cpp)
30 | add_dependencies(set_damping_plugin ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
31 | target_link_libraries(set_damping_plugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES})
32 |
33 |
34 | install(TARGETS set_damping_plugin DESTINATION $ENV{LOCOSIM_DIR}/robot_descriptions/gazebo_plugins/lib)
35 |
--------------------------------------------------------------------------------
/robot_urdf/ur4.srdf:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 0 0 0.055 0.5 -0.5 -0.5 -0.5
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/figs/go1_setup.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Setup Unitree Go1 robot to work with Locosim
4 |
5 | Locosim supports many robots in simulation: UR5, HyQ, Aliengo, Solo, Go1. Recently I managed to interface also two real platforms: Aliengo and Go1. Here I will show you the step to interface Go1 and make it run with Locosim.
6 |
7 | 1) connect your operator PC where you have installed Locosim to the Go1 robot switch via an Ethernet cable
8 |
9 | 1) using your network configuration manager, set a fixed IP for your operator PC in the local network where the robot is connected 192.168.123.X for example:
10 |
11 | ```
12 | 192.168.123.15
13 | ```
14 |
15 | with subnet mask 255.255.255.0 and gateway 192.168.123.1. The Main Control Board on the robot has the IP
16 |
17 | ```
18 | 192.168.123.10
19 | ```
20 |
21 | If you want to be able to sniff the packages coming from the Cameras on the robot you need to add this line to the .bashrc:
22 |
23 | ```
24 | ROS_IP = 192.168.123.15
25 | ```
26 |
27 | 2) turn on the robot with the robot standing on its belly with all the legs close to the body and wait 1 minute. The robot will stand-up automatically.
28 |
29 | 3) press these buttons on the Joystick in sequence:
30 |
31 | ```
32 | L2+A
33 | ```
34 |
35 | locks the joints
36 |
37 | ```
38 | L2+A
39 | ```
40 |
41 | puts the robot in prone state (belly down)
42 |
43 | ```
44 | L2+B
45 | ```
46 |
47 | enters in damping state
48 |
49 | ```
50 | L1+L2+Start
51 | ```
52 |
53 | Enters in external user command mode
--------------------------------------------------------------------------------
/robot_urdf/ur5.srdf:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | 0 0 0.055 0.5 -0.5 -0.5 -0.5
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/install_docker_windows.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | Install Docker on Windows
4 | ================================================================================
5 |
6 | 1. First Install Windows Subsystem for Linux (WSL). Open a command prompt with **administration** privileges and type.
7 |
8 | ``` powershell
9 | wsl --install
10 | ```
11 |
12 | 2. install Ubuntu 20.04.06 LTS from Microsoft Store. All the procedure is explained in detail here:
13 |
14 | https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overv
15 |
16 | 3. From Start run Ubuntu 20.04.06 LTS, this is the procedure you should use to open a new terminal (do not use WSL).
17 |
18 | 4. follow this [procedure](https://github.com/idra-lab/locosim/blob/master/install_docker_linux.md)
19 |
20 |
21 |
22 | ## **Code Management:**
23 |
24 | To create your own code install the tool Visual Studio Code application together with the WSL extension as explained [here](https://code.visualstudio.com/docs/remote/wsl ). This will enable you to edit the code contained in the **trento_lab_home/ros_ws/src** folder.
25 |
26 | To be able to open more terminals on the same window install **terminator**:
27 |
28 | ```powershell
29 | $ sudo apt install terminator
30 | ```
31 |
32 |
33 |
34 | ## **Nvidia Support**:
35 |
36 | If you have a Nvidia GPU install the driver assiciated to your GPU model **directly** in windows downloading it from this [link]( https://www.nvidia.com/Download/index.aspx?lang=en-us ) (not inside Ubuntu!)
37 |
38 | You can check if everything works with:
39 |
40 | ```
41 | nvidia-smi
42 | ```
43 |
44 | If you experiment any issue in using the Nvidia with OpenGL rendering (the symptom is that you cannot visualize STL meshes in RVIZ) then you should update to he latest mesa-driver:
45 |
46 | ```
47 | sudo add-apt-repository ppa:kisak/kisak-mesa
48 | sudo apt update
49 | sudo apt install mesa-utils
50 | ```
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/robot_urdf/simple_geometry.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/figs/utils.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Utilities for Linux
4 |
5 | Here I suggest you a collection of useful utilities to install in your machine:
6 |
7 |
8 |
9 | ```
10 | sudo apt install terminator
11 | ```
12 |
13 | Nice terminal manager with CTRL+E you split the screen vertically and with CTRL+O horizzontally
14 |
15 |
16 |
17 | ```
18 | sudo apt install meld
19 | ```
20 |
21 | Needed to solve conflicts in git operations, when you call **git mergetool**
22 |
23 |
24 |
25 | ```
26 | sudo apt install ipython
27 | ```
28 |
29 | Interactive interface of Python
30 |
31 |
32 |
33 | ```
34 | sudo apt install gedit
35 | ```
36 |
37 | User-friendly text editor with graphical user interface
38 |
39 |
40 |
41 | ```
42 | sudo apt install nano
43 | ```
44 |
45 | Not user friendly text editor without graphical user interface but it always works
46 |
47 |
48 |
49 | ```
50 | sudo apt install cmake-curses-gui
51 | ```
52 |
53 | Terminal base utility to manage configuration files of Cmake, you call with ccmake command, the GUI alternative is obtained installing [cmake-qt-gui](apt://cmake-qt-gui)
54 |
55 |
56 |
57 | ```
58 | sudo apt install git-cola
59 | ```
60 |
61 | User friendly graphical interface to do git operations (commits, etc). A must.
62 |
63 |
64 |
65 | ```
66 | sudo apt install gitg
67 | ```
68 |
69 | Graphical interface equivalent to do **git log** to see the tree of commits
70 |
71 |
72 |
73 | ```
74 | sudo apt install gitk
75 | ```
76 |
77 | Old fashion version of gitg but it allows you to see the history of changes for a single file! gitk -- filename
78 |
79 |
80 |
81 | ```
82 | sudo apt install synaptic
83 | ```
84 |
85 | Package manager that allows you to see where the packages are installed, versions, etc. Very useful.
86 |
87 |
88 |
89 | ```
90 | sudo apt install htop
91 | ```
92 |
93 | Task manager that allows you to see the computational burden of your CPU cores, RAM allocated and process running.
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/network_settings.md:
--------------------------------------------------------------------------------
1 | # Using ROS in multiple machines with heterogeneous networks
2 |
3 | ROS has the important capability to allow the node to be running on different machines and networks.
4 |
5 | The only requirement is that the rosmaster node (i.e. roscore) runs in only one machine. You need to take care that in that specific machine (let's assume that it has an IP: 10.196.80.36) the environment variable ROS_MASTER_URI is set as follows (you can put it in the .bashrc for permanent changes):
6 |
7 | ```
8 | export ROS_MASTER_URI=http://localhost:11311
9 | ```
10 |
11 | In all the other machines that variable should be set with the IP of the machine where the roscore is running, (e.g. in our example 10.196.80.36):
12 |
13 | ```
14 | export ROS_IP=http://IP_OF_ROSCORE_MACHINE:11311
15 | ```
16 |
17 | This tells everbody where the rosmaster is running. Additionally, for all the machines, you need to set the variable ROS_IP to the IP of that specific machine:
18 |
19 | ```
20 | export ROS_MASTER_URI=IP_OF_LOCAL_MACHINE
21 | ```
22 |
23 | this allows the machine to be uniquely recognized across the ROS network. Note that the machines should not necessarily be on the same subnet network! they can be connected physically in different ways (e.g. LAN, WIFI) or on different subnetworks! For example let's assume we want to connect a mobile robot with an UR5 manipulator to design a handing-over task.
24 |
25 | Let's assume that, for some reason, we want to run the roscore on the computer **onboard** the mobile robot. Let's assume that the onboard computer is connected to a laptop computer via WIFI and that the laptop computer, on his behalf, is physically connected to the UR5 robot via an ethernet cable. Let's assume that the WIFI connection is on a subnet 10.196.80.X while the ethernet one is on 192.168.0.X. In this case, the settings should be as in the following Figure:
26 |
27 | 
28 |
--------------------------------------------------------------------------------
/robot_descriptions/gazebo_plugins/set_mass_plugin/src/SetMassPlugin.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | namespace gazebo
10 | {
11 | class DynamicMassPlugin : public ModelPlugin
12 | {
13 | public:
14 | void Load(physics::ModelPtr _model, sdf::ElementPtr /*_sdf*/) override
15 | {
16 | this->model = _model;
17 |
18 | // Set up ROS node
19 | if (!ros::isInitialized())
20 | {
21 | ROS_FATAL_STREAM("A ROS node for Gazebo has not been initialized, unable to load plugin.");
22 | return;
23 | }
24 |
25 | this->rosNode = new ros::NodeHandle();
26 |
27 | // Advertise the set_mass service
28 | this->setMassService = this->rosNode->advertiseService("/set_mass", &DynamicMassPlugin::SetMassCallback, this);
29 |
30 | std::cout << "\033[31mDynamicMassPlugin loaded and ready to set mass. \033[0m" << std::endl;
31 | }
32 |
33 | bool SetMassCallback(gazebo_msgs::SetLinkProperties::Request &req, gazebo_msgs::SetLinkProperties::Response &res)
34 | {
35 | this->link = this->model->GetLink(req.link_name);
36 | if (this->link)
37 | {
38 | // Set the new mass (you can dynamically calculate or pass this value)
39 |
40 | physics::InertialPtr inertial = this->link->GetInertial();
41 | inertial->SetMass(req.mass);
42 |
43 | // Apply the new inertial properties
44 | this->link->SetInertial(inertial);
45 | this->link->UpdateMass();
46 | std::cout << "\033[31mLink mass set to: " << req.mass << "\033[0m" << std::endl;
47 | }
48 | else
49 | {
50 | ROS_ERROR("DynamicMassPlugin: Link not found when setting mass.");
51 | return false;
52 | }
53 |
54 | return true;
55 | }
56 |
57 | ~DynamicMassPlugin()
58 | {
59 | // Clean up
60 | delete this->rosNode;
61 | }
62 |
63 | private:
64 | physics::ModelPtr model;
65 | physics::LinkPtr link;
66 | ros::NodeHandle *rosNode;
67 | ros::ServiceServer setMassService;
68 | };
69 |
70 | // Register the plugin with Gazebo
71 | GZ_REGISTER_MODEL_PLUGIN(DynamicMassPlugin)
72 | }
73 |
--------------------------------------------------------------------------------
/robot_descriptions/gazebo_plugins/set_damping_plugin/src/dynamic_joint_damping_plugin.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | namespace gazebo
9 | {
10 | class DynamicJointDampingPlugin : public ModelPlugin
11 | {
12 | public:
13 | void Load(physics::ModelPtr _model, sdf::ElementPtr /*_sdf*/) override
14 | {
15 | this->model = _model;
16 | if (!ros::isInitialized())
17 | {
18 | ROS_FATAL_STREAM("A ROS node for Gazebo has not been initialized, unable to load plugin.");
19 | return;
20 | }
21 |
22 | this->rosNode = new ros::NodeHandle();
23 | // Advertise the set_joint_damping service
24 | this->setDampingService = this->rosNode->advertiseService("/set_joint_damping", &DynamicJointDampingPlugin::SetDampingCallback, this);
25 | std::cout << "\033[31mDynamicDampingPlugin loaded and ready to set damping. \033[0m" << std::endl;
26 |
27 | // Get all joints in the model
28 | joints = this->model->GetJoints();
29 | std::cout << "\033[31mFound " << joints.size() << " joints in the model \033[0m" << std::endl;
30 | }
31 |
32 | bool SetDampingCallback(set_damping_plugin::SetFloatRequest &req, set_damping_plugin::SetFloatResponse &res)
33 | {
34 |
35 | double new_damping = req.value;
36 | // Iterate through each joint
37 | for (auto &joint : joints)
38 | {
39 | joint->SetDamping(0, new_damping); // first entry is Dof of the joint use 0 for prismatic/revolute joints 1 for ball joints
40 | joint->Update(); // Force physics update
41 |
42 | // Explicitly set damping using ODE parameters (for ODE physics)
43 | // this->joint->SetParam("damping", new_damping);
44 | }
45 | std::cout << "\033[31mDynamicDampingPlugin:Damping set to: " << new_damping << "\033[0m" << std::endl;
46 | return true;
47 | }
48 |
49 | ~DynamicJointDampingPlugin()
50 | {
51 | delete this->rosNode;
52 | }
53 |
54 | private:
55 | physics::ModelPtr model;
56 | physics::JointPtr joint;
57 | ros::NodeHandle *rosNode;
58 | ros::ServiceServer setDampingService;
59 | std::vector joints;
60 | };
61 |
62 | GZ_REGISTER_MODEL_PLUGIN(DynamicJointDampingPlugin)
63 | }
64 |
--------------------------------------------------------------------------------
/robot_urdf/ur4_2links.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | transmission_interface/SimpleTransmission
62 |
63 | PositionJointInterface
64 |
65 |
66 | 1
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/robot_descriptions/gazebo_plugins/set_mass_plugin/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | set_mass_plugin
4 | 0.0.0
5 | The set_mass_plugin package
6 |
7 |
8 |
9 |
10 | mfocchi
11 |
12 |
13 |
14 |
15 |
16 | TODO
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | catkin
52 | gazebo_ros
53 | roscpp
54 | gazebo_ros
55 | roscpp
56 | gazebo_ros
57 | roscpp
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/docker/install_docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [[ "$OSTYPE" == "linux-gnu"* ]]; then
4 | echo "install for LINUX"
5 | sudo apt-get install -y curl
6 |
7 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
8 | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
9 | distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
10 | && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
11 | && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
12 | sudo apt-get update
13 | sudo apt-get install -y docker-ce nvidia-docker2 build-essential cmake
14 |
15 | # Add user to docker's group
16 | sudo usermod -aG docker ${USER}
17 |
18 | if [ -n "$WSL_DISTRO_NAME" ]; then
19 | echo "Running inside WSL"
20 | # Overwrite /etc/wsl.conf with the desired network section
21 | echo "[network]" | sudo tee -a /etc/wsl.conf > /dev/null
22 | echo "generateHosts = false" | sudo tee -a /etc/wsl.conf > /dev/null
23 | else
24 | echo "Not running inside WSL"
25 | fi
26 |
27 |
28 | elif [[ "$OSTYPE" == "darwin"* ]]; then
29 | echo "=== Installing for macOS (Intel or Apple Silicon) ==="
30 |
31 | ARCH=$(uname -m)
32 | echo "Detected architecture: $ARCH"
33 |
34 | # Install Homebrew if missing
35 | if ! command -v brew &> /dev/null; then
36 | echo "Homebrew not found. Installing..."
37 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
38 | else
39 | echo "Homebrew already installed."
40 | fi
41 |
42 | # Install Docker Desktop (auto-selects Intel/ARM build)
43 | if ! ls /Applications | grep -q "Docker.app"; then
44 | echo "Installing Docker Desktop..."
45 | brew install --cask docker
46 | else
47 | echo "Docker Desktop already installed."
48 | fi
49 |
50 | # Intel-specific notice
51 | if [[ "$ARCH" == "x86_64" ]]; then
52 | echo "Intel Mac detected — using x86_64 Docker Desktop build."
53 | fi
54 |
55 | # Apple Silicon notice
56 | if [[ "$ARCH" == "arm64" ]]; then
57 | echo "Apple Silicon detected — using ARM Docker Desktop build."
58 | fi
59 |
60 | echo "⚠️ IMPORTANT: You must open Docker.app manually once after installation."
61 |
62 |
63 |
64 | fi
65 |
66 | # insert/update hosts entry
67 | ip_address="127.0.0.1"
68 | host_name="docker"
69 | docker_folder="trento_lab_home"
70 | # find existing instances in the host file and save the line numbers
71 | matches_in_hosts="$(grep -n $host_name /etc/hosts | cut -f1 -d:)"
72 | host_entry="${ip_address} ${host_name}"
73 |
74 | echo "Please enter your password if requested."
75 |
76 | if [ ! -z "$matches_in_hosts" ]
77 | then
78 | echo "Docker entry already existing in etc/hosts."
79 | else
80 | echo "Adding new hosts entry."
81 | echo "$host_entry" | sudo tee -a /etc/hosts > /dev/null
82 | fi
83 |
84 |
85 |
86 | if [ -d "${HOME}/trento_lab_home" ]; then
87 | echo "Directory trento_lab_home exists."
88 | else
89 | echo "Creating trento_lab_home dir."
90 | mkdir -p ${HOME}/trento_lab_home/ros_ws/src
91 | fi
92 |
93 | # Check if source .ssh exists
94 | if [ -d "$HOME/.ssh" ]; then
95 | echo "Copying .ssh folder with user permissions"
96 | # Ensure destination exists
97 | mkdir -p "$HOME/trento_lab_home/.ssh"
98 |
99 | # Copy contents
100 | sudo cp -R "$HOME/.ssh/"* "$HOME/trento_lab_home/.ssh/"
101 |
102 | # Set ownership
103 | sudo chown -R $USER:$USER "$HOME/trento_lab_home/.ssh"
104 | fi
105 |
106 |
107 |
108 | echo -e "${COLOR_BOLD}To start docker, reboot the system!${COLOR_RESET}"
109 |
--------------------------------------------------------------------------------
/robot_urdf/double_pendulum.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 |
2 | [submodule "ros_impedance_controller"]
3 | path = ros_impedance_controller
4 | url = https://github.com/idra-lab/ros_impedance_controller.git
5 | [submodule "robot_control"]
6 | path = robot_control
7 | url = https://github.com/idra-lab/robot_control.git
8 | [submodule "robot_descriptions/climbingrobot_description"]
9 | path = robot_descriptions/climbingrobot_description
10 | url = https://github.com/idra-lab/climbingrobot_description.git
11 | [submodule "robot_descriptions/ur_description"]
12 | path = robot_descriptions/ur_description
13 | url = https://github.com/idra-lab/ur_description.git
14 | [submodule "robot_descriptions/hyq_description"]
15 | path = robot_descriptions/hyq_description
16 | url = https://github.com/idra-lab/hyq_description.git
17 | [submodule "robot_descriptions/jumpleg_description"]
18 | path = robot_descriptions/jumpleg_description
19 | url = https://github.com/idra-lab/jumpleg_description.git
20 | [submodule "robot_descriptions/solo_description"]
21 | path = robot_descriptions/solo_description
22 | url = https://github.com/idra-lab/solo_description.git
23 | [submodule "robot_descriptions/solo_fw_description"]
24 | path = robot_descriptions/solo_fw_description
25 | url = https://github.com/idra-lab/solo_fw_description.git
26 | [submodule "robot_descriptions/go1_description"]
27 | path = robot_descriptions/go1_description
28 | url = https://github.com/idra-lab/go1_description.git
29 | [submodule "robot_descriptions/aliengo_description"]
30 | path = robot_descriptions/aliengo_description
31 | url = https://github.com/idra-lab/aliengo_description.git
32 | [submodule "robot_hardware_interfaces/base_hardware_interface"]
33 | path = robot_hardware_interfaces/base_hardware_interface
34 | url = https://github.com/idra-lab/base_hardware_interface.git
35 | [submodule "robot_hardware_interfaces/aliengo_hardware_interface"]
36 | path = robot_hardware_interfaces/aliengo_hardware_interface
37 | url = https://github.com/idra-lab/aliengo_hardware_interface.git
38 | [submodule "robot_descriptions/gripper_description"]
39 | path = robot_descriptions/gripper_description
40 | url = https://github.com/idra-lab/gripper_description.git
41 | [submodule "robot_descriptions/myrobot_description"]
42 | path = robot_descriptions/myrobot_description
43 | url = https://github.com/idra-lab/myrobot_description.git
44 | [submodule "robot_descriptions/starbot_description"]
45 | path = robot_descriptions/starbot_description
46 | url = https://github.com/idra-lab/starbot_description.git
47 | [submodule "robot_hardware_interfaces/go1_hardware_interface"]
48 | path = robot_hardware_interfaces/go1_hardware_interface
49 | url = https://github.com/idra-lab/go1_hardware_interface.git
50 | [submodule "robot_hardware_interfaces/ur_driver"]
51 | path = robot_hardware_interfaces/ur_driver
52 | url = https://github.com/idra-lab/universal_robots_ros_driver.git
53 | [submodule "robot_hardware_interfaces/zed_wrapper"]
54 | path = robot_hardware_interfaces/zed_wrapper
55 | url = https://github.com/idra-lab/zed_wrapper.git
56 | [submodule "robot_descriptions/tractor_description"]
57 | path = robot_descriptions/tractor_description
58 | url = https://github.com/idra-lab/tractor_description.git
59 | [submodule "robot_descriptions/z1_description"]
60 | path = robot_descriptions/z1_description
61 | url = https://github.com/idra-lab/z1_description.git
62 | [submodule "robot_descriptions/go2_description"]
63 | path = robot_descriptions/go2_description
64 | url = https://github.com/idra-lab/go2_description.git
65 | [submodule "robot_descriptions/orchard_world"]
66 | path = robot_descriptions/orchard_world
67 | url = https://github.com/idra-lab/orchard_world.git
68 | [submodule "robot_descriptions/sensors_description"]
69 | path = robot_descriptions/sensors_description
70 | url = https://github.com/idra-lab/sensors_description.git
71 | [submodule "robot_descriptions/invpend_description"]
72 | path = robot_descriptions/invpend_description
73 | url = https://github.com/idra-lab/invpend_description.git
74 | [submodule "robot_descriptions/anymal_d_description"]
75 | path = robot_descriptions/anymal_d_description
76 | url = https://github.com/idra-lab/anymal_d_description.git
77 |
--------------------------------------------------------------------------------
/figs/zed_calibration.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Zed camera calibration
4 |
5 | Inside the zed_wrapper package, I implemented a calibration procedure for the ZED2 camera using an Aruco marker. In essence you need to run the script:
6 |
7 | ```
8 | rosrun zed_wrapper camera_calibration.py
9 | ```
10 |
11 | this will run two nodes: 1) the zed_wrapper driver, 2) the aruco_ros package. Then the script will get the TF between the camera and the Aruco marker, and, since the position of the Aruco marker w.r.t. the Base Frame is suposed to be known (I measured it), by the law of composition of transforms it spits out on screen the TF (3D position of the origin of the frame + 3 values for the Euler Angles for the orientation) between the Base Frame and the camera frame. Every time yo do a new calibration, you should set the values obtained for the position and orientation of the camera (w.r.t the base frame) in here:
12 |
13 | https://github.com/mfocchi/robot_control/blob/25569e7ad103d58ae0b6095f7ccd570975b36218/lab_exercises/lab_palopoli/ur5_generic.py#L51
14 |
15 | You can perform a sanity check the value of visualizing a blue blob (center_pointW) corresponding to the 3D coordinates detected from the center point of the camera:
16 |
17 | https://github.com/mfocchi/robot_control/blob/25569e7ad103d58ae0b6095f7ccd570975b36218/lab_exercises/lab_palopoli/ur5_generic.py#L356
18 |
19 | if you run the zed2 driver alone (e.g. you run roslaunch zed_wrapper zed2.launch rviz:=true) you should update the values for the camera center and RPY angles in here:
20 |
21 | https://github.com/mfocchi/zed_wrapper/blob/e76e95ecec46dad738ee1d693f608fafeee6a789/zed_wrapper/launch/zed2.launch#L66
22 |
23 | # Zed camera usage
24 |
25 | The resolution set by default both in the real robot in simulation is (1080p = 1920x1080), you can check in simulation the resolution in this commit:
26 |
27 | https://github.com/mfocchi/ur_description/commit/2c45a3294876a55c4c5b0439266f9c62a52bdf33
28 |
29 | To get the 3D point data you need to subscribe to the "/ur5/zed_node/point_cloud/cloud_registered" message:
30 |
31 | https://github.com/mfocchi/robot_control/blob/traj_optimization/lab_exercises/lab_palopoli/ur5_generic.py#L140
32 |
33 | The point-cloud is published in different frames, in simulation and on the real robot. On the real robot is "zed2_camera_center", while in simulation is "zed2_left_camera_optical_frame". Therefore you need to consider different transforms in the two cases to have the point cloud data expressed in the world file, as I do here (since they are fixed transforms you can print and copy them in your code):
34 |
35 | https://github.com/mfocchi/robot_control/blob/traj_optimization/lab_exercises/lab_palopoli/ur5_generic.py#L177
36 |
37 | To extract the data from the PointCloud2 message you need to provide the points in the image plane for which you want to know the 3D coordinates. To do this you should call the function read_points passing the indexes (u,v) as done here:
38 |
39 | https://github.com/mfocchi/robot_control/blob/traj_optimization/lab_exercises/lab_palopoli/ur5_generic.py#L264
40 |
41 | so to get the center of the image you need to call with u =960 v =540. The center of the image will correspond to the origin of the camera frame, which, as I said, is different on real robot and simulation. I summarized everything in this drawing:
42 |
43 | https://github.com/mfocchi/locosim/blob/develop/figs/zed_camera.pdf
44 |
45 | If you are using Yolo for object detection this library returns points belonging to a squared image 640x640 (whatever resolution you give in input), so you need to multiply the value of indexes that you get in YOLO by different scaling factors:
46 |
47 | s_u = 960/640 (for u)
48 |
49 | s_v = 540/640 (for v)
50 |
51 | once you get the 3D point, to get meaningful results for your planning, you should map it to the world frame considering the appropriate rotation matrix w_R_c and offset w_x_c of the camera frame origin that you can obtain here:
52 |
53 | https://github.com/mfocchi/robot_control/blob/10bc564604a3337b2cc38cc8555d0cadefccc7e4/lab_exercises/lab_palopoli/ur5_generic.py#L184
54 |
55 | https://github.com/mfocchi/robot_control/blob/10bc564604a3337b2cc38cc8555d0cadefccc7e4/lab_exercises/lab_palopoli/ur5_generic.py#L185
56 |
57 |
--------------------------------------------------------------------------------
/loco-install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ubuntu_version=0
4 | install_realsense_camera=false
5 | install_graspin=false
6 |
7 | # Parse command-line options
8 | while getopts ":u:hrg" option; do
9 | case $option in
10 | u) ubuntu_version=$OPTARG;;
11 | r) install_realsense_camera=true;;
12 | g) install_graspin=true;;
13 | h)
14 | echo "Usage: loco-install -u [-r] [-g] [-h]"
15 | echo " -u : Supported versions are 18 or 20."
16 | echo " -r: Install RealSense camera packages."
17 | echo " -g: Install GraspIn packages."
18 | echo " -h: Display this help message."
19 | echo "Note: Options can be placed before or after the version number."
20 | exit 0
21 | ;;
22 | \?) # Handle invalid options
23 | echo "Usage: loco-install -u [-r] [-g] [-h]"
24 | exit 1
25 | ;;
26 | esac
27 | done
28 |
29 | # Check Ubuntu supported version
30 | if [ "$ubuntu_version" != "18" ] && [ "$ubuntu_version" != "20" ]; then
31 | echo "Ubuntu versions supported are 18 or 20"
32 | exit 1
33 | fi
34 |
35 | # Set up prefix to use for installation
36 | if [ "$ubuntu_version" == "18" ]; then
37 | PYTHON_PREFIX="python3"
38 | PYTHON_VERSION="3.5"
39 | ROBOTPKG_PYTHON_VERSION="py35"
40 | PIP_PREFIX="pip3"
41 | ROS_VERSION="bionic"
42 | elif [ "$ubuntu_version" == "20" ]; then
43 | PYTHON_PREFIX="python3"
44 | PYTHON_VERSION="3.8"
45 | ROBOTPKG_PYTHON_VERSION="py38"
46 | PIP_PREFIX="pip3"
47 | ROS_VERSION="noetic"
48 | fi
49 |
50 | # Install base libraries
51 | sudo apt install -qqy lsb-release gnupg2 curl
52 |
53 | # Adds repositories
54 | if [ ! -e /etc/apt/sources.list.d/ros-latest.list ] || \
55 | ! grep -q "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" /etc/apt/sources.list.d/ros-latest.list; \
56 | then
57 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
58 | fi
59 |
60 | if [ ! -e /etc/apt/sources.list.d/robotpkg.list ] || \
61 | ! grep -q "deb \[arch=amd64\] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg" "/etc/apt/sources.list.d/robotpkg.list"; \
62 | then
63 | sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg' >> /etc/apt/sources.list.d/robotpkg.list"
64 | fi
65 |
66 | if [ ! -e /etc/apt/sources.list.d/robotpkg.list ] || \
67 | ! grep -q "deb \[arch=amd64\] http://robotpkg.openrobots.org/wip/packages/debian/pub $(lsb_release -sc) robotpkg" /etc/apt/sources.list.d/robotpkg.list ; \
68 | then
69 | sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/wip/packages/debian/pub $(lsb_release -sc) robotpkg' >> /etc/apt/sources.list.d/robotpkg.list"
70 | fi
71 |
72 | # Adds apt keys
73 | curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -
74 |
75 | curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
76 |
77 | # Download packages
78 | sudo apt install -y "ros-$ROS_VERSION-desktop-full"
79 |
80 | sudo apt install -y "ros-$ROS_VERSION-urdfdom-py" \
81 | "ros-$ROS_VERSION-srdfdom" \
82 | "ros-$ROS_VERSION-joint-state-publisher" \
83 | "ros-$ROS_VERSION-joint-state-publisher-gui" \
84 | "ros-$ROS_VERSION-joint-state-controller" \
85 | "ros-$ROS_VERSION-gazebo-msgs" \
86 | "ros-$ROS_VERSION-control-toolbox" \
87 | "ros-$ROS_VERSION-gazebo-ros" \
88 | "ros-$ROS_VERSION-controller-manager" \
89 | "ros-$ROS_VERSION-joint-trajectory-controller" \
90 | "ros-$ROS_VERSION-catkin"
91 |
92 | if [ $install_realsense_camera = true ]; then
93 | sudo apt install -y "ros-$ROS_VERSION-openni2-launch" \
94 | "ros-$ROS_VERSION-openni2-camera" \
95 | "ros-$ROS_VERSION-realsense2-description"
96 | fi
97 |
98 | if [ $install_graspin = true ]; then
99 | sudo apt install -y "ros-$ROS_VERSION-eigen-conversions" \
100 | "ros-$ROS_VERSION-object-recognition-msgs" \
101 | "ros-$ROS_VERSION-roslint"
102 | fi
103 |
104 | sudo apt update -y
105 |
106 | sudo apt install -y "robotpkg-$ROBOTPKG_PYTHON_VERSION-eigenpy" \
107 | "robotpkg-$ROBOTPKG_PYTHON_VERSION-pinocchio" \
108 | "robotpkg-$ROBOTPKG_PYTHON_VERSION-quadprog"
109 |
110 | sudo apt install -y "$PYTHON_PREFIX-scipy" \
111 | "$PYTHON_PREFIX-matplotlib" \
112 | "$PYTHON_PREFIX-termcolor" \
113 | "$PYTHON_PREFIX-pip" \
114 | "$PYTHON_PREFIX-catkin-tools"
115 |
116 | $PIP_PREFIX install cvxpy==1.2.0
117 |
118 | if ! grep -q "source /opt/ros/$ROS_VERSION/setup.bash" ~/.bashrc; then
119 | echo "source /opt/ros/$ROS_VERSION/setup.bash" >> ~/.bashrc
120 | fi
121 |
--------------------------------------------------------------------------------
/robot_urdf/hyq.srdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/robot_urdf/solo.srdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | # ==========================================================
2 | # Ubuntu 20.04 + ROS Noetic full desktop
3 | # ==========================================================
4 | FROM osrf/ros:noetic-desktop-full
5 |
6 | ENV DEBIAN_FRONTEND=noninteractive \
7 | TZ=Etc/UTC \
8 | LANG=en_US.UTF-8 \
9 | LC_ALL=en_US.UTF-8
10 |
11 | # -----------------------------
12 | # Base system dependencies
13 | # -----------------------------
14 | RUN apt-get update && apt-get install -y --no-install-recommends \
15 | locales tzdata curl wget gnupg2 lsb-release ca-certificates \
16 | software-properties-common git build-essential cmake \
17 | python3 python3-pip \
18 | && rm -rf /var/lib/apt/lists/*
19 |
20 | RUN locale-gen en_US.UTF-8
21 |
22 | # -----------------------------
23 | # Install ROS build tools
24 | # -----------------------------
25 | RUN apt-get update && apt-get install -y --no-install-recommends \
26 | python3-rosdep python3-vcstool python3-colcon-common-extensions \
27 | && rm -rf /var/lib/apt/lists/*
28 |
29 | # -----------------------------
30 | # Initialize rosdep
31 | # -----------------------------
32 | RUN rosdep init || true && rosdep update
33 |
34 | # -----------------------------
35 | # Install useful ROS packages
36 | # -----------------------------
37 | RUN apt-get update && apt-get install -y --no-install-recommends \
38 | ros-noetic-urdfdom-py \
39 | ros-noetic-srdfdom \
40 | ros-noetic-joint-state-publisher \
41 | ros-noetic-joint-state-publisher-gui \
42 | ros-noetic-joint-state-controller \
43 | ros-noetic-gazebo-msgs \
44 | ros-noetic-control-toolbox \
45 | ros-noetic-gazebo-ros \
46 | ros-noetic-controller-manager \
47 | ros-noetic-joint-trajectory-controller \
48 | ros-noetic-catkin \
49 | ros-noetic-openni2-launch \
50 | ros-noetic-openni2-camera \
51 | ros-noetic-realsense2-description \
52 | ros-noetic-eigen-conversions \
53 | ros-noetic-object-recognition-msgs \
54 | ros-noetic-roslint \
55 | ros-noetic-ur-msgs \
56 | ros-noetic-speed-scaling-interface \
57 | ros-noetic-scaled-joint-trajectory-controller \
58 | ros-noetic-speed-scaling-state-controller \
59 | ros-noetic-ur-client-library \
60 | ros-noetic-pass-through-controllers \
61 | ros-noetic-gazebo-plugins \
62 | ros-noetic-gazebo-ros-control \
63 | ros-noetic-ros-control \
64 | ros-noetic-transmission-interface \
65 | ros-noetic-imu-tools \
66 | ros-noetic-tf2-ros \
67 | ros-noetic-tf2-tools \
68 | ros-noetic-industrial-robot-status-controller \
69 | rospack-tools \
70 | liburdfdom-tools \
71 | && rm -rf /var/lib/apt/lists/*
72 |
73 | # -----------------------------
74 | # Python
75 | # -----------------------------
76 | RUN apt-get update && apt-get install -y --no-install-recommends \
77 | python3-scipy \
78 | python3-matplotlib \
79 | python3-termcolor \
80 | python3-tk \
81 | python3-catkin-pkg \
82 | python3-rospkg \
83 | python3-rosdep \
84 | && rm -rf /var/lib/apt/lists/*
85 |
86 | RUN pip3 install --no-cache-dir \
87 | cvxpy==1.2.0 \
88 | shapely \
89 | quadprog \
90 |
91 | # -----------------------------
92 | # robotpkg (Focal → py38)
93 | # -----------------------------
94 | RUN set -eux; \
95 | install -d -m 0755 /etc/apt/keyrings; \
96 | curl -fsSL http://robotpkg.openrobots.org/packages/debian/robotpkg.key \
97 | | gpg --dearmor -o /etc/apt/keyrings/robotpkg-archive-keyring.gpg; \
98 | chmod 0644 /etc/apt/keyrings/robotpkg-archive-keyring.gpg; \
99 | echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/robotpkg-archive-keyring.gpg] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg" >> /etc/apt/sources.list.d/robotpkg.list; \
100 | echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/robotpkg-archive-keyring.gpg] http://robotpkg.openrobots.org/wip/packages/debian/pub $(lsb_release -sc) robotpkg" >> /etc/apt/sources.list.d/robotpkg.list;
101 |
102 | RUN apt-get update && apt-get install -y --no-install-recommends \
103 | robotpkg-py38-eigenpy \
104 | robotpkg-py38-pinocchio \
105 | robotpkg-py38-quadprog \
106 | && rm -rf /var/lib/apt/lists/*
107 |
108 | # -----------------------------
109 | # Utilities and GUI dependencies
110 | # -----------------------------
111 | RUN apt-get update && apt-get install -y --no-install-recommends \
112 | gedit gitg git-cola iputils-ping net-tools \
113 | libxext6 libxrender1 libxtst6 libxi6 libfreetype6 fonts-dejavu \
114 | libgl1-mesa-glx libgtk-3-0 \
115 | && rm -rf /var/lib/apt/lists/*
116 |
117 | # -----------------------------
118 | # Patch roslaunch to reduce shutdown timeout
119 | # -----------------------------
120 | RUN python3 - <<'PY'
121 | import re, pathlib
122 | paths = [
123 | pathlib.Path("/opt/ros/noetic/lib/python3/dist-packages/roslaunch/nodeprocess.py"),
124 | pathlib.Path("/usr/lib/python3/dist-packages/roslaunch/nodeprocess.py"),
125 | ]
126 | for p in paths:
127 | if p.exists():
128 | s = p.read_text()
129 | s = re.sub(r'(_TIMEOUT_SIGINT\s*=\s*)[0-9.]+', r'\g<1>0.1', s)
130 | s = re.sub(r'(_TIMEOUT_SIGTERM\s*=\s*)[0-9.]+', r'\g<1>0.1', s)
131 | p.write_text(s)
132 | print("Patched:", p)
133 | break
134 | PY
135 |
136 | # Source ROS automatically use single quote to have it literal and avoid expansion of empty $PYTHONPATH
137 | RUN echo '#!/bin/bash' >> /etc/bash.bashrc && \
138 | echo 'source /opt/ros/noetic/setup.bash' >> /etc/bash.bashrc && \
139 | echo '[ -f /root/ros_ws/install/setup.bash ] && source /root/ros_ws/install/setup.bash' >> /etc/bash.bashrc && \
140 | echo 'export LOCOSIM_DIR=/root/ros_ws/src/locosim' >> /etc/bash.bashrc && \
141 | echo 'export PATH=/opt/openrobots/bin:$PATH' >> /etc/bash.bashrc && \
142 | echo 'export DISABLE_ROS1_EOL_WARNINGS=1' >> /etc/bash.bashrc && \
143 | echo 'export PYTHONPATH=/opt/openrobots/lib/python3.8/site-packages:$LOCOSIM_DIR/robot_control:$PYTHONPATH' >> /etc/bash.bashrc && \
144 | echo 'export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/opt/openrobots/share/' >> /etc/bash.bashrc && \
145 | echo 'alias pycharm='\''/root/pycharm/bin/pycharm.sh'\''' >> /etc/bash.bashrc
146 | RUN chmod +x /etc/bash.bashrc
147 |
148 | # your container now always runs Bash as a login shell, /etc/bash.bashrc will be sourced automatically.
149 | ENTRYPOINT []
150 | # Start bash by default (interactive login shell)
151 | CMD ["/bin/bash", "--login", "-i"]
152 |
153 |
--------------------------------------------------------------------------------
/install_docker_linux.md:
--------------------------------------------------------------------------------
1 | Installation with Docker
2 | ================================================================================
3 |
4 | - Run the script install_docker.sh. This script is important because it installs the docker client on your machine and adds to your user the privileges to run the docker images, and create new folder.
5 |
6 |
7 | ```
8 | $sudo apt install curl
9 | $curl -o install_docker.sh https://raw.githubusercontent.com/idra-lab/locosim/refs/heads/master/docker/install_docker.sh
10 | $sudo chmod +x install_docker.sh
11 | $./install_docker.sh
12 | ```
13 | - If everything went smooth you should read: **To start docker, reboot the system!** You can now restart the PC so that all changes made can be applied.
14 | - If you look into your **host** Ubuntu home directory, you will see that the **trento_lab_home** directory has been created with **/ros_ws/src** subfolders.
15 | - now you can clone the loco_nav code inside the **trento_lab_home/ros_ws/src** folder
16 |
17 |
18 | ```
19 | $ cd ~/trento_lab_home/ros_ws/src
20 | $ git clone https://github.com/idra-lab/locosim.git --recursive
21 | ```
22 |
23 | **NOTE:** when you clone the code, be sure to have a stable and fast connection. Before continuing, be sure you properly checked out **all** the submodules without any error.
24 |
25 | - Now you have two options:
26 |
27 | A) Download the docker image from here:
28 |
29 | ```
30 | docker pull mfocchi/trento_lab_framework:locosim
31 | ```
32 |
33 | B) compile the docker image yourself:
34 |
35 | ```
36 | cd ~/trento_lab_home/ros_ws/src/locosim/docker
37 | docker build -t mfocchi/trento_lab_framework:locosim -f Dockerfile .
38 | ```
39 |
40 | - Now, you need to configure the bash environment of your Ubuntu machine as follows. Open the `bashrc` file from your home folder:
41 |
42 |
43 | ```
44 | $ gedit ~/.bashrc
45 | ```
46 |
47 | - and add the following lines at the bottom of the file:
48 |
49 | ```bash
50 | alias lab_locosim='xhost +local:root; \
51 | docker rm -f docker_container >/dev/null 2>&1 || true; \
52 | docker run --name docker_container --gpus all \
53 | --workdir="/root" \
54 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
55 | --device=/dev/dri:/dev/dri \
56 | --network=host --hostname=docker -it \
57 | --env="DISPLAY=$DISPLAY" \
58 | --env="QT_X11_NO_MITSHM=1" \
59 | --privileged --shm-size 2g --rm \
60 | --volume $HOME/trento_lab_home:/root \
61 | mfocchi/trento_lab_framework:locosim'
62 | alias dock-other='docker exec -it docker_container /bin/bash'
63 | ```
64 |
65 | - Load the .bashrc script (next time you will open a terminal this will be automatically loaded).
66 |
67 |
68 | ```
69 | $ source ~/.bashrc
70 | ```
71 |
72 | **NOTE!** If you do not have an Nvidia card in your computer, you should skip the parts about the installation of the drivers, and you can still run the docker **without** the **--gpus all** in the **lab_locosim** alias.
73 |
74 | - Open a terminal and run the "lab_locosim" alias:
75 |
76 | ```
77 | $ lab_locosim
78 | ```
79 |
80 | - You should see your terminal change from `user@hostname` to `user@docker`.
81 | - the **lab_locosim** script will mount the folder `~/trento_lab_home` on your **host** computer. Inside of all of the docker images this folder is mapped to `$HOME`.This means that any files you place in your docker $HOME folder will survive the stop/starting of a new docker container. All other files and installed programs will disappear on the next run.
82 | - The alias **lab_locosim** needs to be called only ONCE and opens the image. To link other terminals to the same image you should run **dock-other**, this second command will "**attach**" to the image opened previously by calling the **lab_locosim** alias. You can call **lab_locosim** only once and **dock-other** as many times you need to open multiple terminals.
83 |
84 |
85 |
86 | # Compiling the code
87 |
88 | - Now you can compile the ROS workspace in the $HOME directory **inside** docker:
89 |
90 |
91 | ```
92 | $ cd /root/ros_ws/
93 | $ catkin_make install
94 | ```
95 |
96 | - Only once, after the first compilation do:
97 |
98 | ```
99 | $ source /root/ros_ws/install/setup.bash
100 | ```
101 |
102 | **NOTE:** when you run the code, if an error pops-up that tells you a recently compiled package cannot be found you need to run:
103 |
104 | ```
105 | $ rospack profile
106 | ```
107 |
108 | This function crawls through the packages in ROS_ROOT and ROS_PACKAGE_PATH, read and parse the package.xml for each package, and assemble a complete dependency tree for all packages.
109 |
110 | Now you are ready to run the code as explained [here](https://github.com/idra-lab/locosim?tab=readme-ov-file#running-the-software-from-python-ide-pycharm).
111 |
112 | When you have finished exit from the container typing:
113 |
114 | ```
115 | $ exit
116 | ```
117 |
118 |
119 |
120 | # **Committing the image** (optional)
121 |
122 | To install new packages open a terminal and call the apt install **without** sudo. To store the changes in the local image, get the ASH (a number) of the active container with:
123 |
124 | ```powershell
125 | $ docker ps
126 | ```
127 |
128 | 14. Commit the docker image (next time you will open an new container it will retain the changes done to the image without loosing them):
129 |
130 | ```powershell
131 | $ docker commit ASH mfocchi/trento_lab_framework:locosim
132 | ```
133 |
134 |
135 |
136 | # Docker Issues (optional)
137 |
138 |
139 |
140 | Check this section only if you had any issues in running the docker!
141 |
142 | - When launching any graphical interface inside docker (e.g. pycharm or gedit) you get this error:
143 |
144 | ```
145 | No protocol specified
146 | Unable to init server: Could not connect: Connection refused
147 |
148 | (gedit:97): Gtk-WARNING **: 08:21:29.767: cannot open display: :0.0
149 | ```
150 |
151 | It means that docker is not copying properly the value of you DISPLAY environment variable, you could try to solve it in this way, in a terminal **outside docker** launch:
152 |
153 | ```
154 | echo $DISPLAY
155 | ```
156 |
157 | and you will obtain a **value** (e.g. :0) if you run the same command in a docker terminal the value will be different, then in the .bashrc inside the docker add the following line:
158 |
159 | ```
160 | export DISPLAY=value
161 | ```
162 |
163 | - If you still have issues because of the x11 library maybe you are running on wayland, be sure you have installed the qt5 library:
164 |
165 | ```
166 | apt install -y qt5-default
167 | ```
168 |
169 | and add this to your .bashrc
170 |
171 | ```
172 | export XDG_SESSION_TYPE=x11
173 | ```
174 |
175 |
176 |
177 |
178 |
--------------------------------------------------------------------------------
/robot_urdf/ur4.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 | transmission_interface/SimpleTransmission
206 |
207 | PositionJointInterface
208 |
209 |
210 | 1
211 |
212 |
213 |
214 | transmission_interface/SimpleTransmission
215 |
216 | PositionJointInterface
217 |
218 |
219 | 1
220 |
221 |
222 |
223 | transmission_interface/SimpleTransmission
224 |
225 | PositionJointInterface
226 |
227 |
228 | 1
229 |
230 |
231 |
232 | transmission_interface/SimpleTransmission
233 |
234 | PositionJointInterface
235 |
236 |
237 | 1
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
--------------------------------------------------------------------------------
/install_docker_mac.md:
--------------------------------------------------------------------------------
1 | # Index
2 | - [Index](#index)
3 | - [Installation](#installation)
4 | - [Installing Docker Desktop for MacOS](#installing-docker-desktop-for-macos)
5 | - [Setting up the locosim folder](#setting-up-the-locosim-folder)
6 | - [Running](#running)
7 | - [Pulling the Docker image](#pulling-the-docker-image)
8 | - [Running the Docker container](#running-the-docker-container)
9 | - [Editing files](#editing-files)
10 | - [Compiling and running the code](#compiling-and-running-the-code)
11 | - [Git](#git)
12 | - [Saving the image (optional)](#saving-the-image-optional)
13 | - [WARNINGS](#warnings)
14 | - [TL;DR](#tldr)
15 |
16 |
17 | # Installation
18 |
19 | ## Installing Docker Desktop for MacOS
20 |
21 | While it is possible to install Docker for MacOS using [HomeBrew](https://brew.sh/), we suggest to use the official Docker installation that can be found [here](https://docs.docker.com/desktop/install/mac-install/).
22 |
23 | Once you have installed Docker, you will find the Docker Desktop app in your Applications folder. Open it and follow the instructions to complete the setup.
24 |
25 | To check that docker is running properly, open a terminal and type:
26 | ```bash
27 | docker run --rm hello-world
28 | ```
29 |
30 | If this returns a message similar to the following, then you have not started Docker Desktop:
31 | ```
32 | docker: Cannot connect to the Docker daemon at unix:///Users/user/.docker/run/docker.sock. Is the docker daemon running?.
33 | ```
34 |
35 | Simply start Docker Desktop from the Applications folder and try again.
36 |
37 | If you have problems with Docker installation, [contact me](mailto:enrico.saccon@unitn.it).
38 |
39 |
40 | ## Setting up the locosim folder
41 |
42 | In your host machine, create the folder `locosim/ros_ws/src` in your home directory:
43 |
44 | ```bash
45 | mkdir -p ~/locosim/ros_ws/src
46 | ```
47 |
48 | Then navigate to it and clone the locosim repository with:
49 | ```bash
50 | cd ~/locosim/ros_ws/src
51 | git clone https://github.com/idra-lab/locosim.git
52 | git submodule update --init
53 | ```
54 |
55 | **NOTE:** when you clone the code, be sure to have a stable and fast connection. Before continuing, be sure you properly checked out **all** the submodules without any error.
56 |
57 | # Running
58 |
59 | ## Pulling the Docker image
60 |
61 | - Download ONE of the docker images:
62 |
63 | ```bash
64 | docker pull chaff800/locosim:noetic
65 | docker pull chaff800/locosim:noetic_pycharm
66 | ```
67 |
68 | The second image has PyCharm already installed based on [Readme.md](README.md) instructions.
69 |
70 | The images are based on [this image](https://hub.docker.com/r/tiryoh/ros-desktop-vnc).
71 |
72 | Change its name so that it is easier to remember:
73 |
74 | ```bash
75 | docker tag chaff800/locosim:noetic locosim:noetic
76 | ```
77 |
78 | ## Running the Docker container
79 |
80 | Before running the following commands, check section **WARNINGS** at the end of this document.
81 |
82 | To run the container, use the command:
83 |
84 | ```bash
85 | docker run --name locosim_c --rm -v ~/locosim/ros_ws/:/home/ubuntu/ros_ws/ -p 6080:80 --shm-size=512m --platform linux/amd64 locosim:noetic
86 | ```
87 |
88 | If everything went smooth you should see the following message on the terminal:
89 |
90 | ```bash
91 | INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
92 | INFO Set uid to user 0 succeeded
93 | INFO RPC interface 'supervisor' initialized
94 | CRIT Server 'unix_http_server' running without any HTTP authentication checking
95 | INFO supervisord started with pid 38
96 | INFO spawned: 'novnc' with pid 40
97 | INFO spawned: 'vnc' with pid 41
98 | INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
99 | INFO success: vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
100 | ```
101 |
102 | You can now open a web browser and type the address [`http://localhost:6080/vnc.html`](`http://localhost:6080/vnc.html`) to open the VNC window. The desktop of the container should appear.
103 |
104 | If needed, the username of the user inside the container is `ubuntu` and the password is `ubuntu`. The user does have root privileges on the container, not on the host machine.
105 |
106 | **Note**: there may be errors regarding permissions denied for files in .git folders. You can ignore them, they should not affect the execution of the code.
107 |
108 | ## Editing files
109 |
110 | You can edit the files of the `locosim` package using any text editor or IDE installed on your host Mac machine. All changes will be reflected inside the container because you mounted the folder `locosim` as a volume.
111 |
112 | Alternatively, if you want to edit files directly inside the container, the Codium IDE is already installed. To open it, click on the Codium icon on the desktop of the container. Also vim is already installed. Finally, the image is based on Ubuntu 18.04, so you can install (almost) any other text editor you may need.
113 |
114 | ## Compiling and running the code
115 |
116 | To compile the code, open a terminal inside the container (there is a terminal icon on the desktop) and type:
117 |
118 | ```bash
119 | cd /home/ubuntu/ros_ws/
120 | catking_make
121 | catkin_make install
122 | source /home/ubuntu/ros_ws/install/setup.bash
123 | ```
124 |
125 | All dependencies should be already installed in the image. If you need to install new packages, remember to commit the image after installing them (see section **Saving the image (optional)** below).
126 |
127 | Obviously, when you run the container again, you need to use the new image name instead of `locosim:noetic` in the docker run command.
128 |
129 | **Note**: since we have mounted the `locosim` folder as a volume, the compiled files will be stored on your host Mac machine in the same folder. This means that if you re-create the container, you do not need to re-compile the code again unless you delete the compiled files from your host machine. If you do not want to have the compiled files on your host machine, you can remove the ` -v` option from the docker run command above. In this case, the compiled files will be stored inside the container and will be lost when you delete the container (unless you commit the image each time before exiting).
130 |
131 | ## Git
132 |
133 | Git is installed in the container, but the permissions from the `.git` folder inside your host machine are not transferred to the container. The easiest way is to use git directly from your host Mac machine whenever you want to commit changes to the code or push.
134 |
135 | While I highly discourage this step, if you want to use git inside the container, you need to set up your ssh keys and git configuration inside the container as well. Also, remove the `locosim/ros_ws/src/locosim` folder in your host machine and clone the repository again from inside the container, otherwise you will have permission problems.
136 |
137 | ## Saving the image (optional)
138 |
139 | Let's say that you have installed new packages inside the container or have made changes to the container that you want to save. You can commit the changes to a new image with the command:
140 |
141 | ```bash
142 | docker commit ros_noetic_c
143 | ```
144 | 9. Follow the instructions in the main [README](README.md) file to run the code.
145 |
146 | Add `-m "your message"` to add a commit message.
147 |
148 | Obviously, when you run the container again, you need to use the new image name instead of `locosim:noetic` in the docker run command.
149 |
150 | You do not need to save the image if you have just made changes to the code inside the mounted volume, as these changes are automatically saved on your host machine.
151 |
152 | The container suggests to log out before committing the image to avoid problems. It should not be strictly necessary, but if you want to be safe, just log out before committing.
153 |
154 |
155 | # WARNINGS
156 |
157 | - The option ` -v` in the docker run command means that you are mounting a volume and ANY change you do inside the container in the folder `/home/ubuntu/ros_ws/src/locosim` will be reflected on your host machine in the folder `locosim/ros_ws/src/locosim`. Be careful when deleting files or folders inside the container because they will be deleted also on your host machine.
158 | - The option `--rm` means that when you exit from the container, it will be deleted. If you want to keep the container after exiting, remove this option from the docker run command. It goes without saying, that the volumes that you mount with the ` -v` option will be kept on your host machine in any case.
159 | - The option `--shm-size=512m` is important because it increases the size of the shared memory of the container. Some ROS nodes may need a big amount of shared memory to work properly. If you do not set this option, some nodes may crash during their execution.
160 | - The option `--platform linux/amd64` is important if you are using a Mac with M* chip. It forces the container to run in emulation mode for x86_64 architecture. This may slow down a bit the execution of the code but it is necessary because most of the docker images available are built for x86_64 architecture.
161 |
162 |
163 | # TL;DR
164 |
165 | 1. Install Docker Desktop for MacOS from [here](https://docs.docker.com/desktop/install/mac-install/).
166 | 2. Create the folder `locosim/ros_ws/src` in your home directory.
167 | 3. Clone the [locosim](https://github.com/mfocchi/locosim) repository in the folder `locosim/ros_ws/src` with submodules.
168 | 4. Pull the docker image with `docker pull chaff800/locosim:noetic` and tag it as `locosim:noetic`.
169 | 5. Run the container with the command:
170 | ```bash
171 | docker run --name ros_noetic_c --rm -v ~/locosim/:/home/ubuntu/ros_ws/ -p 6080:80 --shm-size=512m --platform linux/amd64 locosim:noetic
172 | ```
173 | 6. Open a web browser and go to [`http://localhost:6080/vnc.html`](http://localhost:6080/vnc.html) to open the VNC window.
174 | 7. Edit the code using any text editor or IDE on your host machine (files are in `~/locosim/ros_ws/src/locosim`).
175 | 8. Open a terminal inside the container and compile the code with:
176 | ```bash
177 | cd /home/ubuntu/ros_ws/
178 | catkin_make
179 | catkin_make install
180 | source /home/ubuntu/ros_ws/install/setup.bash
181 | ```
182 | 9. Follow the instructions in [here](https://github.com/idra-lab/locosim?tab=readme-ov-file#running-the-software-from-python-ide-pycharm) to run the code.
183 |
184 |
--------------------------------------------------------------------------------
/install_native.md:
--------------------------------------------------------------------------------
1 | # Install dependencies
2 |
3 | ### UBUNTU VERSIONS:
4 |
5 | Locosim is compatible with Ubuntu 18/20. The installation instructions have been generalized accordingly. You need replace four strings (PYTHON_PREFIX, PYTHON_VERSION, PIP_PREFIX, ROS_VERSION) with the appropriate values according to your operating systems as follows:
6 |
7 | | Ubuntu 18: | **Ubuntu 20**: |
8 | | ---------------------------- | ---------------------------- |
9 | | PYTHON_PREFIX = python3 | PYTHON_PREFIX = python3 |
10 | | PYTHON_VERSION = 3.5 | PYTHON_VERSION = 3.8 |
11 | | ROBOTPKG_PYTHON_VERSION=py35 | ROBOTPKG_PYTHON_VERSION=py38 |
12 | | PIP_PREFIX = pip3 | PIP_PREFIX = pip3 |
13 | | ROS_VERSION = bionic | ROS_VERSION = noetic |
14 |
15 | **NOTE:** ROS is no longer supported (only ROS2 Humble) on Ubuntu 22 hence is not possible to install Locosim on Ubuntu 22.
16 |
17 | ### Install ROS
18 |
19 | setup your source list:
20 |
21 | ```
22 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
23 | ```
24 |
25 | Set up your keys:
26 |
27 | ```
28 | curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -
29 | ```
30 |
31 | install ROS main distro:
32 |
33 | ```
34 | sudo apt-get install ros-ROS_VERSION-desktop-full
35 | ```
36 |
37 | install ROS packages:
38 |
39 | ```
40 | sudo apt-get install ros-ROS_VERSION-urdfdom-py
41 | ```
42 |
43 | ```
44 | sudo apt-get install ros-ROS_VERSION-srdfdom
45 | ```
46 |
47 | ```
48 | sudo apt-get install ros-ROS_VERSION-joint-state-publisher
49 | ```
50 |
51 | ```
52 | sudo apt-get install ros-ROS_VERSION-joint-state-publisher-gui
53 | ```
54 |
55 | ```
56 | sudo apt-get install ros-ROS_VERSION-joint-state-controller
57 | ```
58 |
59 | ```
60 | sudo apt-get install ros-ROS_VERSION-gazebo-msgs
61 | ```
62 |
63 | ```
64 | sudo apt-get install ros-ROS_VERSION-control-toolbox
65 | ```
66 |
67 | ```
68 | sudo apt-get install ros-ROS_VERSION-gazebo-ros
69 | ```
70 |
71 | ```
72 | sudo apt-get install ros-ROS_VERSION-controller-manager
73 | ```
74 |
75 | ```
76 | sudo apt install ros-ROS_VERSION-joint-trajectory-controller
77 | ```
78 |
79 | ### Pinocchio stuff
80 |
81 | **Add robotpkg as source repository to apt:**
82 |
83 | ```
84 | sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg' >> /etc/apt/sources.list.d/robotpkg.list"
85 | ```
86 |
87 | ```
88 | sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/wip/packages/debian/pub $(lsb_release -sc) robotpkg' >> /etc/apt/sources.list.d/robotpkg.list"
89 | ```
90 |
91 | **Register the authentication certificate of robotpkg:**
92 |
93 | ```
94 | sudo apt install -qqy lsb-release gnupg2 curl
95 | ```
96 |
97 | ```
98 | curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
99 | ```
100 |
101 | You need to run at least once apt update to fetch the package descriptions:
102 |
103 | ```
104 | sudo apt-get update
105 | ```
106 |
107 | Now you can install Pinocchio and the required libraries:
108 |
109 | ```
110 | sudo apt install robotpkg-PINOCCHIO_PYTHON_VERSION-eigenpy
111 | ```
112 |
113 | ```
114 | sudo apt install robotpkg-PINOCCHIO_PYTHON_VERSION-pinocchio
115 | ```
116 |
117 | ```
118 | sudo apt-get install robotpkg-PINOCCHIO_PYTHON_VERSION-quadprog
119 | ```
120 |
121 | **NOTE:** If you have issues in installing robotpkg libraries you can try to install them through ROS as:
122 |
123 | ```
124 | sudo apt-get install ros-ROS_VERSION-LIBNAME
125 | ```
126 |
127 |
128 |
129 | ### Python
130 |
131 | ```
132 | sudo apt-get install PYTHON_PREFIX-scipy
133 | ```
134 |
135 | ```
136 | sudo apt-get install PYTHON_PREFIX-matplotlib
137 | ```
138 |
139 | ```
140 | sudo apt-get install PYTHON_PREFIX-termcolor
141 | ```
142 |
143 | ```
144 | sudo apt install python3-pip
145 | ```
146 |
147 | ```
148 | PIP_PREFIX install cvxpy==1.2.0
149 | ```
150 |
151 | ### **Support for Realsense camera (simulation)**
152 |
153 | This packages are needed if you want to see the PointCloud published by a realsense camera attached at the endeffector. To activate it, you should load the xacro of the ur5 with the flag "vision_sensor:=true".
154 |
155 | ```
156 | sudo apt-get install ros-ROS_VERSION-openni2-launch
157 | ```
158 |
159 | ```
160 | sudo apt-get install ros-ROS_VERSION-openni2-camera
161 | ```
162 |
163 | ```
164 | sudo apt install ros-ROS_VERSION-realsense2-description
165 | ```
166 |
167 | ### **Support to simulate Grasping**
168 |
169 | Unfortunately grasping in Gazebo is still an open issue, I impelented grasping using this [plugin]( https://github.com/JenniferBuehler/gazebo-pkgs/wiki/Installation) that creates a fixed link between the gripper and the object to be grasped. To activate the grasping plugin set gripper_sim parameter to True in your configuration file. The following dependencies are required:
170 |
171 | ```
172 | sudo apt-get install ros-ROS_VERSION-eigen-conversions
173 | ```
174 |
175 | ```
176 | sudo apt-get install ros-ROS_VERSION-object-recognition-msgs
177 | ```
178 |
179 | ```
180 | sudo apt install ros-ROS_VERSION-roslint
181 | ```
182 |
183 | You can check which parameters have to be tuned looking to the following [wiki]( https://github-wiki-see.page/m/JenniferBuehler/gazebo-pkgs/wiki/The-Gazebo-grasp-fix-plugin)
184 |
185 |
186 |
187 | # Configure environment variables
188 |
189 | ```
190 | gedit ~/.bashrc
191 | ```
192 |
193 | copy the following lines (at the end of the .bashrc), remember to replace the string PYTHON_VERSION with the appropriate version name as explained in [software versions](#software-versions) section:
194 |
195 | ```
196 | source /opt/ros/ROS_VERSION/setup.bash
197 | source $HOME/ros_ws/install/setup.bash
198 | export PATH=/opt/openrobots/bin:$PATH
199 | export LOCOSIM_DIR=$HOME/ros_ws/src/locosim
200 | export PYTHONPATH=/opt/openrobots/lib/pythonPYTHON_VERSION/site-packages:$LOCOSIM_DIR/robot_control:$PYTHONPATH
201 | export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/opt/openrobots/share/
202 | ```
203 |
204 | the .bashrc is a file that is **automatically** sourced whenever you open a new terminal.
205 |
206 | **NOTE**: people with some operating systems like ARCH LINUX, might need to add "export ROS_IP=127.0.0.1" to the .bashrc.
207 |
208 |
209 |
210 |
211 | # Download code and setup ROS workspace
212 |
213 | Now that you installed all the dependencies you are ready to get the code, but first you need to create a ros workspace to out the code in:
214 |
215 | ```
216 | mkdir -p ~/ros_ws/src
217 | ```
218 |
219 | ```
220 | cd ~/ros_ws/src
221 | ```
222 |
223 | Now you can clone the repository inside the ROS workspace you just created:
224 |
225 | ```
226 | git clone https://github.com/mfocchi/locosim.git --recursive
227 | ```
228 |
229 | this command should also clone all the submodules, if you want to update them separately just run
230 |
231 | ```
232 | git submodule update --init --recursive
233 | ```
234 |
235 | source the environment variables
236 |
237 | ```
238 | source $HOME/.bashrc
239 | ```
240 |
241 | now compile (then this step won't bee needed anymore if you just work in python unless you do not modify / create additional ROS packages)
242 |
243 | ```
244 | cd ~/ros_ws/
245 | ```
246 |
247 | ```
248 | catkin_make install
249 | ```
250 |
251 | the install step install the ros packages inside the "$HOME/ros_ws/install" folder rather than the devel folder. This folder will be added to the ROS_PACKAGE_PATH instead of the devel one. Whenever you modify some of the ROS packages (e.g. the ones that contain the xacro fles inside the robot_description folder), you need to install them to be sure they are been updated in the ROS install folder.
252 |
253 | Finally, run (you should do it any time you add a new ros package)
254 |
255 | ```
256 | rospack profile
257 | ```
258 |
259 | There are some additional utilities that I strongly suggest to install. You can find the list [here](https://github.com/mfocchi/locosim/blob/develop/figs/utils.md).
260 |
261 | **IMPORTANT!**
262 |
263 | The first time you compile the code the install folder is not existing, therefore won't be added to the PYTHONPATH with the command **source $HOME/ros_ws/install/setup.bash**, and you won't be able to import the package ros_impedance_controller. Therefore, **only once**, after the first time that you compile, run again :
264 |
265 | ```
266 | source $HOME/ros_ws/install/setup.bash
267 | ```
268 |
269 | Now you are ready to run the code as explained [here](https://github.com/idra-lab/locosim?tab=readme-ov-file#running-the-software-from-python-ide-pycharm).
270 |
271 |
272 |
273 | Installing Git and SSH key (optional)
274 | ==============
275 |
276 | To install Git you can open a terminal and run:
277 |
278 | ```
279 | sudo apt install git
280 | ```
281 |
282 | After that, you can check the version installed and configure the credentials with:
283 |
284 | ```
285 | $ git --version
286 | $ git config --global user.name <"name surnace">
287 | $ git config --global user.email <"youremail@yourdomain.it">
288 | ```
289 |
290 | After this, if you don't have an SSH key for your Github account, you need to create a new one to use the repositories:
291 |
292 | * go to Settings/SSH and GPG Keys
293 |
294 | * open a terminal and run these commands:
295 |
296 | ```
297 | $ ssh-keygen
298 | $ cd ~/.ssh/
299 | $ cat id_rsa.pub
300 | ```
301 |
302 | Copy the content of your public SSH into the box at the link before and press "New SSH key". You can now clone the repositories with SSH without having to issue the password every time (I suggest to do not set any passphrase).
303 |
304 |
305 |
306 | # Tips and Tricks (optional)
307 |
308 | 1) Most of virtual machines including Virtualbox, do not have support for GPU. This means that if you run Gazebo Graphical User Interface (GUI) it can become very **slow**. A way to mitigate this is to avoid to start the Gazebo GUI and only start the gzserver process that will compute the dynamics, you will keep the visualization in Rviz. This is referred to planners that employ BaseController or BaseControllerFixed classes. In the Python code where you start the simulator you need to pass this additional argument as follows:
309 |
310 | ```
311 | additional_args = 'gui:=false'
312 | p.startSimulator(..., additional_args =additional_args)
313 | ```
314 |
315 | 2) Another annoying point is the default timeout to kill Gazebo that is by default very long. You can change it (e.g. to 0.1s) by setting the _TIMEOUT_SIGINT = 0.1 and _TIMEOUT_SIGTERM = 0.1:
316 |
317 | ```
318 | sudo gedit /opt/ros/ROS_VERSION/lib/PYTHON_PREFIX/dist-packages/roslaunch/nodeprocess.py
319 | ```
320 |
321 | this will cause ROS to send a `kill` signal much sooner.
322 |
323 |
324 |
325 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # What is Locosim?
4 |
5 | Locosim is a didactic framework to learn/test basic controllers schemes on quadruped robots (HyQ/Solo/Aliengo/Go1 are supported) and manipulators (UR5 is supported). Locosim has been successfully tested on Ur5, Aliengo and Go1 robots and (to my knowledge) is the first Open-Source Easy-to-Use interface to the new Unitree Quadruped robot Go1. If you just bought a Go1 robot and you want to give a try, follow this [wiki](https://github.com/mfocchi/locosim/blob/develop/figs/go1_setup.md)!
6 |
7 | Locosim is composed by a **roscontrol** node called **ros_impedance_controller** (written in C++) that interfaces a python ROS node (where the controller is written) to a Gazebo simulator. All the didactic labs have a description, with exercises of increasing complexity, in the folder **lab_descriptions** inside robot_control submodule. For each controller, plotting / logging utilities are available to evaluate the results together with a configuration file (LX_conf.py) to change the controller parameters.
8 |
9 | You have 3 ways to get the Locosim code: 1) with docker 2) by manual installation of dependencies.
10 |
11 | **Note**: If you intend to use Locosim for your *research* please cite:
12 |
13 | - M. Focchi, F. Roscia, C. Semini, **Locosim: an Open-Source Cross-Platform Robotics Framework**, Synergetic Cooperation between Robots and Humans. CLAWAR, 2023.
14 |
15 | you can download a pre-print of the paper [here](https://iit-dlslab.github.io/papers/focchi23clawar.pdf). [View BibTeX](https://github.com/mfocchi/locosim/blob/develop/locosim.bib)
16 |
17 |
18 |
19 | # Docker Installation
20 |
21 | You can alternatively use a docker image that contains Ubuntu 20 and all the required dependencies already installed (you will need only to clone the code and compile it).
22 |
23 | **LINUX**: follow this [procedure](https://github.com/idra-lab/locosim/blob/master/install_docker_linux.md).
24 |
25 | **MAC:** follow this [procedure](https://github.com/idra-lab/locosim/blob/master/install_docker_mac.md).
26 |
27 | **WINDOWS:** follow this [procedure](https://github.com/idra-lab/locosim/blob/master/install_docker_windows.md).
28 |
29 |
30 |
31 | # Native Installation
32 |
33 | **LINUX:** follow this [procedure](https://github.com/idra-lab/locosim/blob/master/install_native.md).
34 |
35 | **MAC:** follow this [procedure](https://github.com/idra-lab/locosim/blob/master/install_native.md), just replace **"sudo apt install package_name"** with **"brew install package_name"**.
36 |
37 | **WINDOWS:** Install Ubuntu 20.4.06 LTS following this procedure: https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview
38 |
39 | If you experiment any issue in using the Nvidia with OpenGL rendering (the symptom is that you cannot visualize STL meshes in RVIZ) then you should update to the latest mesa-driver:
40 |
41 | ```
42 | sudo add-apt-repository ppa:kisak/kisak-mesa
43 | sudo apt update
44 | sudo apt install mesa-utils
45 | ```
46 |
47 | then follow this [procedure](https://github.com/idra-lab/locosim/blob/master/install_native.md).
48 |
49 |
50 |
51 | # **Running the software from Python IDE: Pycharm**
52 |
53 | Now that you compiled the code you are ready to run the software!
54 |
55 | We recommend to use an IDE to run and edit the python files, like Pycharm community.
56 |
57 | 1. To install it, enter in the $HOME folder of the docker and download it from here:
58 |
59 | ```
60 | $ wget https://download.jetbrains.com/python/pycharm-community-2021.1.1.tar.gz
61 | ```
62 |
63 | 2. Then, unzip the program:
64 |
65 | ```
66 | $tar -xf pycharm-community-2021.1.1.tar.gz
67 | ```
68 |
69 | and unzip it *inside* the docker (e.g. copy it inside the `~/trento_lab_home` folder.
70 |
71 | **IMPORTANT**!** I ask you to download this specific version (2021.1.1) that I am sure it works, because the newer ones seem to be failing to load environment variables!
72 |
73 | 3. To run Pycharm community type (if you are lazy you can create an alias...):
74 |
75 | ```
76 | $ pycharm-community-2021.1.1/bin/pycharm.sh
77 | ```
78 |
79 | Running pycharm from the terminal enables to use the environment variables loaded inside the .bashrc.
80 |
81 | 4. click "Open File or Project" and open the folder robot_control. Then launch one of the labs in locosim/robot_control/lab_exercises or in locosim/robot_control/base_controllers (e.g. ur5_generic.py) right click on the code and selecting "Run File in Pyhton Console"
82 |
83 | 5. the first time you run the code you will be suggested to select the appropriate interpreter (/usr/binpython3.8). Following this procedure you will be sure that the run setting will be stored, next time that you start Pycharm.
84 |
85 |
86 |
87 | # Running the Software from terminal
88 |
89 | To run from a terminal we use the interactive option that allows when you close the program have access to variables:
90 |
91 | ```
92 | $ python3 -i $LOCOSIM_DIR/robot_control/base_controllers/base_controller.py
93 | ```
94 |
95 | to exit from python3 console type CTRL+Z
96 |
97 |
98 |
99 | Installing NVIDIA drivers (optional)
100 | ==============
101 |
102 | If your PC is provided with an NVIDIA graphics card, you can install its drivers in Ubuntu by following these steps:
103 |
104 | add the repository
105 |
106 | ```
107 | sudo add-apt-repository ppa:graphics-drivers/ppa
108 | ```
109 |
110 | update the repository list:
111 |
112 | ```
113 | sudo apt-get update
114 | ```
115 |
116 | Install the driver, note that for Ubuntu 20.04 the 515 version is ok, for Ubuntu 22.04 the 535 is ok, but you can use also other versions:
117 |
118 | ```
119 | sudo apt-get install nvidia-driver-X
120 | ```
121 |
122 | The reboot the system
123 |
124 | ```
125 | sudo reboot
126 | ```
127 |
128 | Now tell the system to use that driver:
129 |
130 | * open the _Software & Updates_ application
131 | * go to "Additional Drivers" and select the latest driver you just installed with "proprietary, tested" description
132 | * press on "Apply Changes".
133 |
134 | You can verify if the drivers are installed by opening a terminal and running:
135 |
136 | ```
137 | nvidia-smi
138 | ```
139 |
140 | If this does not work, and you are sure you correctly installed the drivers, you might need to deactivate the "safe boot" feature from your BIOS, that usually prevents to load the driver.
141 |
142 |
143 |
144 | # Using the real robots
145 |
146 | These packages are needed if you are willing to do experiments with the **real** robots
147 |
148 | ### **Universal Robot UR5**
149 |
150 | The driver for the UR5 has already been included in Locosim but is not compiled by default, hence you need to:
151 |
152 | 1. remove file [CATKIN_IGNORE](https://github.com/mfocchi/universal_robots_ros_driver/blob/master/CATKIN_IGNORE) inside the **ur_driver** package
153 | 2. remove file [CATKIN_IGNORE]( https://github.com/mfocchi/zed_wrapper/blob/af3750a31c1933d4f25b0cb9d5fc4de657d62001/CATKIN_IGNORE) inside the **zed_wrapper** package
154 | 3. Install these additional packages:
155 |
156 | ```
157 | sudo apt install ros-ROS_VERSION-ur-msgs
158 | ```
159 |
160 | ```
161 | sudo apt install ros-ROS_VERSION-speed-scaling-interface
162 | ```
163 |
164 | ```
165 | sudo apt install ros-ROS_VERSION-scaled-joint-trajectory-controller
166 | ```
167 |
168 | ```
169 | sudo apt install ros-ROS_VERSION-industrial-robots-status-interface
170 | ```
171 |
172 | ```
173 | sudo apt install ros-ROS_VERSION-speed-scaling-state-controller
174 | ```
175 |
176 | ```
177 | sudo apt install ros-ROS_VERSION-ur-client-library
178 | ```
179 |
180 | ```
181 | sudo apt install ros-ROS_VERSION-pass-through-controllers
182 | ```
183 |
184 | 4. recompile with **catkin_make install**.
185 | 5. add the following alias to your .bashrc
186 |
187 | ```
188 | launch_robot='roslaunch ur_robot_driver ur5e_bringup.launch headless_mode:=true robot_ip:=192.168.0.100 kinematics_config:=$LOCOSIM_DIR/robot_hardware_interfaces/ur_driver/calibration_files/my_robot_calibration_X.yaml'
189 | ```
190 |
191 | where X is {1,2}. For the robot with the soft gripper X = 2.
192 |
193 | 4. Trigger the robot workbench power switch on and press the on button on the UR5 Teach Pendant
194 |
195 | 5. Connect the Ethernet cable to the lab laptop and create a local LAN network where you set the IP of your machine to 192.168.0.101 (the robot IP will be 192.168.0.100, double check it using the UR5 "Teach Pendant"), see [network settings](https://github.com/mfocchi/locosim/blob/develop/network_settings.md) to setup the network in order to run together with a mobile platform.
196 |
197 | 6. Verify that you can ping the robot:
198 |
199 | ```
200 | ping 192.168.0.100
201 | ```
202 |
203 | 7. Where it says "Spegnimento" activate the robot pressing "Avvio" twice until you see all the 5 green lights and you hear the release of the brakes. Set the "Remote Control" in the upper right corner of the "Teach Pendant"
204 |
205 | 8. Run the **launch_robot** alias to start the **ur_driver**. If you want to start the driver without the ZED camera (e.g. you do not have CUDA installed), append **vision_sensor:=false** to the command.
206 |
207 | ```
208 | launch_robot vision_sensor:=false
209 | ```
210 |
211 | Conversely, if you want to launch only the ZED camera alone and see the data in rviz:
212 |
213 | ```
214 | roslaunch zed_wrapper zed2.launch rviz:=true
215 | ```
216 |
217 | 9. Run the **ur5_generic.py** with the [real_robot](https://github.com/mfocchi/robot_control/blob/2e88a9a1cc8b09753fa18e7ac936514dc1d27b8d/lab_exercises/lab_palopoli/params.py#L30) flag set to **True**. The robot will move to the home configuration defined [here](https://github.com/mfocchi/robot_control/blob/babb5ff9ad09fec32c7ceaeef3d02715c6d067ab/lab_exercises/lab_palopoli/params.py#L26).
218 |
219 | 10. For the usage and calibration of the ZED camera follow this instructions [here](https://github.com/mfocchi/locosim/blob/develop/figs/zed_calibration.md).
220 |
221 |
222 |
223 | **Universal Robots + Gripper**
224 |
225 | You have 2 kind of gripper available in the ur5 robot: a rigid 3 finger gripper and a soft 2 finger gripper. Locosim seamlessly allows you to deal with both of them. By default, the 3 finger gripper is enabled, if you want to use the 2 finger one (soft_gripper) you need to:
226 |
227 | 1. set the [soft_gripper](https://github.com/mfocchi/robot_control/blob/fde3b27884819e1b2ea319fe5b2781a86d33a648/lab_exercises/lab_palopoli/params.py#L33) flag to True (in Simulation)
228 |
229 | 2. append **soft_gripper:=true** to the **launch_robot** alias (on the real robot).
230 |
231 |
232 |
233 | **Universal Robots + ZED camera support**
234 |
235 | If you are willing to use the real ZED Camera on the real robot, the zed_wrapper package is not compiled by default, hence you need to:
236 |
237 | 1. remove the file [CATKIN_IGNORE]( https://github.com/mfocchi/zed_wrapper/blob/af3750a31c1933d4f25b0cb9d5fc4de657d62001/CATKIN_IGNORE) in the **zed_wrapper** package
238 |
239 | 2. Install CUDA (locosim is compatible only with version 12): https://developer.nvidia.com/cuda-downloads
240 |
241 | 3. Install the SDK library (locosim is compatible only with version 4.0.2) in: https://www.stereolabs.com/developers/release/
242 |
243 | 4. Recompile with catkin_make install
244 |
245 | If you have issues remove the build/devel folder and recompile.
246 |
247 |
248 |
249 | ### Go1 Quadruped Robot
250 |
251 | install these packages:
252 |
253 | ```
254 | sudo apt-get install apt-get install liblcms2-2
255 | ```
256 |
257 | ```
258 | sudo apt-get install apt-get install liblcms-bin
259 | ```
260 |
261 | and follow this [wiki](https://github.com/mfocchi/locosim/blob/develop/go1_setup.md)!
262 |
263 |
--------------------------------------------------------------------------------
/robot_urdf/jumpleg.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | /jumpleg
11 | gazebo_ros_control/DefaultRobotHWSim
12 | true
13 | 0.004
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 | xacro
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 | transmission_interface/SimpleTransmission
284 |
285 | hardware_interface/EffortJointInterface
286 |
287 |
288 | hardware_interface/EffortJointInterface
289 | 1
290 |
291 |
292 |
293 |
294 | transmission_interface/SimpleTransmission
295 |
296 | hardware_interface/EffortJointInterface
297 |
298 |
299 | hardware_interface/EffortJointInterface
300 | 1
301 |
302 |
303 |
304 |
305 | transmission_interface/SimpleTransmission
306 |
307 | hardware_interface/EffortJointInterface
308 |
309 |
310 | hardware_interface/EffortJointInterface
311 | 1
312 |
313 |
314 |
315 | true
316 |
317 |
318 | true
319 |
320 |
321 | true
322 |
323 |
324 | 1000000.0
325 | 100.0
326 | 1.5
327 | 1.5
328 | 1 0 0
329 | 1.0
330 | 0.00
331 |
332 |
333 | 1000000.0
334 | 100.0
335 | 1.0
336 | 1.0
337 | 1.0
338 | 1
339 |
340 | true
341 | 1000.0
342 |
343 | lf_lower_leg_fixed_joint_lump__lf_foot_collision_1
344 |
345 |
347 |
348 | /jumpleg/lf_foot_bumper
349 | jumpleg
350 |
351 |
352 | Gazebo/Black
353 |
354 |
355 | transmission_interface/SimpleTransmission
356 |
357 | hardware_interface/EffortJointInterface
358 |
359 |
360 | hardware_interface/EffortJointInterface
361 | 1
362 |
363 |
364 |
365 | transmission_interface/SimpleTransmission
366 |
367 | hardware_interface/EffortJointInterface
368 |
369 |
370 | hardware_interface/EffortJointInterface
371 | 1
372 |
373 |
374 |
375 | transmission_interface/SimpleTransmission
376 |
377 | hardware_interface/EffortJointInterface
378 |
379 |
380 | hardware_interface/EffortJointInterface
381 | 1
382 |
383 |
384 |
385 |
--------------------------------------------------------------------------------
/robot_urdf/ur5.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 | transmission_interface/SimpleTransmission
377 |
378 | PositionJointInterface
379 |
380 |
381 | 1
382 |
383 |
384 |
385 | transmission_interface/SimpleTransmission
386 |
387 | PositionJointInterface
388 |
389 |
390 | 1
391 |
392 |
393 |
394 | transmission_interface/SimpleTransmission
395 |
396 | PositionJointInterface
397 |
398 |
399 | 1
400 |
401 |
402 |
403 | transmission_interface/SimpleTransmission
404 |
405 | PositionJointInterface
406 |
407 |
408 | 1
409 |
410 |
411 |
412 | transmission_interface/SimpleTransmission
413 |
414 | PositionJointInterface
415 |
416 |
417 | 1
418 |
419 |
420 |
421 | transmission_interface/SimpleTransmission
422 |
423 | PositionJointInterface
424 |
425 |
426 | 1
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
--------------------------------------------------------------------------------
/robot_urdf/climbingrobot.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | /climbingrobot
12 | gazebo_ros_control/DefaultRobotHWSim
13 | true
14 | 0.001
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
42 |
49 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
232 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 | 1000000.0
380 | 100.0
381 | 1.8
382 | 1.8
383 | 1.0
384 | 1
385 |
386 | true
387 | 1000.0
388 |
389 | lower_link_fixed_joint_lump__foot_collision_1
390 |
391 |
393 |
394 | /climbingrobot/foot_bumper
395 |
396 | foot
397 |
398 |
399 | Gazebo/Black
400 |
401 |
402 | transmission_interface/SimpleTransmission
403 |
404 | hardware_interface/EffortJointInterface
405 |
406 |
407 | hardware_interface/EffortJointInterface
408 | 1
409 |
410 |
411 |
412 | transmission_interface/SimpleTransmission
413 |
414 | hardware_interface/EffortJointInterface
415 |
416 |
417 | hardware_interface/EffortJointInterface
418 | 1
419 |
420 |
421 |
422 | transmission_interface/SimpleTransmission
423 |
424 | hardware_interface/EffortJointInterface
425 |
426 |
427 | hardware_interface/EffortJointInterface
428 | 1
429 |
430 |
431 |
432 | transmission_interface/SimpleTransmission
433 |
434 | hardware_interface/EffortJointInterface
435 |
436 |
437 | hardware_interface/EffortJointInterface
438 | 1
439 |
440 |
441 |
442 | transmission_interface/SimpleTransmission
443 |
444 | hardware_interface/EffortJointInterface
445 |
446 |
447 | hardware_interface/EffortJointInterface
448 | 1
449 |
450 |
451 |
452 | transmission_interface/SimpleTransmission
453 |
454 | hardware_interface/EffortJointInterface
455 |
456 |
457 | hardware_interface/EffortJointInterface
458 | 1
459 |
460 |
461 |
462 | transmission_interface/SimpleTransmission
463 |
464 | hardware_interface/EffortJointInterface
465 |
466 |
467 | hardware_interface/EffortJointInterface
468 | 1
469 |
470 |
471 |
472 | transmission_interface/SimpleTransmission
473 |
474 | hardware_interface/EffortJointInterface
475 |
476 |
477 | hardware_interface/EffortJointInterface
478 | 1
479 |
480 |
481 |
482 | transmission_interface/SimpleTransmission
483 |
484 | hardware_interface/EffortJointInterface
485 |
486 |
487 | hardware_interface/EffortJointInterface
488 | 1
489 |
490 |
491 |
492 |
--------------------------------------------------------------------------------
/robot_urdf/hyq.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | /hyq
10 | gazebo_ros_control/DefaultRobotHWSim
11 | true
12 | 0.004
13 |
14 |
15 | /hyq
16 | trunk
17 | ground_truth
18 | world
19 | 0 0 0
20 | 0 0 0
21 | 0
22 | true
23 | 250.0
24 |
25 |
26 |
27 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | 1.5
81 | 1.5
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 | transmission_interface/SimpleTransmission
197 |
198 | hardware_interface/EffortJointInterface
199 |
200 |
201 | 1
202 |
203 |
204 |
205 |
206 | transmission_interface/SimpleTransmission
207 |
208 | hardware_interface/EffortJointInterface
209 |
210 |
211 | 1
212 |
213 |
214 |
215 |
216 | transmission_interface/SimpleTransmission
217 |
218 | hardware_interface/EffortJointInterface
219 |
220 |
221 | 1
222 |
223 |
224 |
225 | true
226 |
227 |
228 | true
229 |
230 |
231 | true
232 |
233 |
234 | 1000000.0
235 | 100.0
236 | 1.5
237 | 1.5
238 | 1 0 0
239 | 1.0
240 | 0.00
241 |
242 |
243 | 1000000.0
244 | 100.0
245 | 1.0
246 | 1.0
247 | 1.0
248 | 1
249 |
250 | true
251 | 250.0
252 |
253 | lf_lowerleg_collision
254 |
255 |
257 |
258 | /hyq/lf_shin_bumper
259 |
260 |
261 |
262 |
263 | 1000000.0
264 | 100.0
265 | 1.0
266 | 1.0
267 | 1.0
268 | 1
269 |
270 | true
271 | 250.0
272 |
273 | lf_lowerleg_fixed_joint_lump__lf_foot_collision_1
274 |
275 |
277 |
278 | /hyq/lf_foot_bumper
279 | hyq
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 | transmission_interface/SimpleTransmission
397 |
398 | hardware_interface/EffortJointInterface
399 |
400 |
401 | 1
402 |
403 |
404 |
405 |
406 | transmission_interface/SimpleTransmission
407 |
408 | hardware_interface/EffortJointInterface
409 |
410 |
411 | 1
412 |
413 |
414 |
415 |
416 | transmission_interface/SimpleTransmission
417 |
418 | hardware_interface/EffortJointInterface
419 |
420 |
421 | 1
422 |
423 |
424 |
425 | true
426 |
427 |
428 | true
429 |
430 |
431 | true
432 |
433 |
434 | 1000000.0
435 | 100.0
436 | 1.5
437 | 1.5
438 | 1 0 0
439 | 1.0
440 | 0.00
441 |
442 |
443 | 1000000.0
444 | 100.0
445 | 1.0
446 | 1.0
447 | 1.0
448 | 1
449 |
450 | true
451 | 250.0
452 |
453 | rf_lowerleg_collision
454 |
455 |
457 |
458 | /hyq/rf_shin_bumper
459 |
460 |
461 |
462 |
463 | 1000000.0
464 | 100.0
465 | 1.0
466 | 1.0
467 | 1.0
468 | 1
469 |
470 | true
471 | 250.0
472 |
473 | rf_lowerleg_fixed_joint_lump__rf_foot_collision_1
474 |
475 |
477 |
478 | /hyq/rf_foot_bumper
479 | hyq
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 | transmission_interface/SimpleTransmission
597 |
598 | hardware_interface/EffortJointInterface
599 |
600 |
601 | 1
602 |
603 |
604 |
605 |
606 | transmission_interface/SimpleTransmission
607 |
608 | hardware_interface/EffortJointInterface
609 |
610 |
611 | 1
612 |
613 |
614 |
615 |
616 | transmission_interface/SimpleTransmission
617 |
618 | hardware_interface/EffortJointInterface
619 |
620 |
621 | 1
622 |
623 |
624 |
625 | true
626 |
627 |
628 | true
629 |
630 |
631 | true
632 |
633 |
634 | 1000000.0
635 | 100.0
636 | 1.5
637 | 1.5
638 | 1 0 0
639 | 1.0
640 | 0.00
641 |
642 |
643 | 1000000.0
644 | 100.0
645 | 1.0
646 | 1.0
647 | 1.0
648 | 1
649 |
650 | true
651 | 250.0
652 |
653 | lh_lowerleg_collision
654 |
655 |
657 |
658 | /hyq/lh_shin_bumper
659 |
660 |
661 |
662 |
663 | 1000000.0
664 | 100.0
665 | 1.0
666 | 1.0
667 | 1.0
668 | 1
669 |
670 | true
671 | 250.0
672 |
673 | lh_lowerleg_fixed_joint_lump__lh_foot_collision_1
674 |
675 |
677 |
678 | /hyq/lh_foot_bumper
679 | hyq
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 | transmission_interface/SimpleTransmission
797 |
798 | hardware_interface/EffortJointInterface
799 |
800 |
801 | 1
802 |
803 |
804 |
805 |
806 | transmission_interface/SimpleTransmission
807 |
808 | hardware_interface/EffortJointInterface
809 |
810 |
811 | 1
812 |
813 |
814 |
815 |
816 | transmission_interface/SimpleTransmission
817 |
818 | hardware_interface/EffortJointInterface
819 |
820 |
821 | 1
822 |
823 |
824 |
825 | true
826 |
827 |
828 | true
829 |
830 |
831 | true
832 |
833 |
834 | 1000000.0
835 | 100.0
836 | 1.5
837 | 1.5
838 | 1 0 0
839 | 1.0
840 | 0.00
841 |
842 |
843 | 1000000.0
844 | 100.0
845 | 1.0
846 | 1.0
847 | 1.0
848 | 1
849 |
850 | true
851 | 250.0
852 |
853 | rh_lowerleg_collision
854 |
855 |
857 |
858 | /hyq/rh_shin_bumper
859 |
860 |
861 |
862 |
863 | 1000000.0
864 | 100.0
865 | 1.0
866 | 1.0
867 | 1.0
868 | 1
869 |
870 | true
871 | 250.0
872 |
873 | rh_lowerleg_fixed_joint_lump__rh_foot_collision_1
874 |
875 |
877 |
878 | /hyq/rh_foot_bumper
879 | hyq
880 |
881 |
882 |
883 |
884 |
--------------------------------------------------------------------------------