Skip to content

Instantly share code, notes, and snippets.

View traversaro's full-sized avatar
🐑

Silvio Traversaro traversaro

🐑
View GitHub Profile
@traversaro
traversaro / CMakeLists.txt
Last active June 28, 2024 14:03
Simple qt6/qt5 program
cmake_minimum_required(VERSION 3.16)
# Set the project name and version
project(HelloWorld VERSION 1.0 LANGUAGES CXX)
# Find the Qt package
option(USE_QT6 "ON for Qt6, OFF for Qt5" ON)
if(USE_QT6)
find_package(Qt6 REQUIRED COMPONENTS Widgets)
else()
@traversaro
traversaro / env.yaml
Last active May 7, 2024 08:06
Conda environment to test lerobot
name: lerobot
channels:
- conda-forge
dependencies:
- python=3.10
- pip
- wandb
- zarr
- torchvision
- pytorch
@traversaro
traversaro / testswig.cpp
Created April 28, 2024 17:04
Swig Friend Method Minimum Reproducible Example
#include "testswig.h"
ClassWithProtectedFriendMethod::ClassWithProtectedFriendMethod()
{
}
ClassWithProtectedFriendMethod::protectedFriendMethod()
{
return -42.0;
}
[project]
name = "my_project"
requires-python = ">=3.9"
dependencies = [
"numpy",
]
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
(mujoco) traversaro@IITBMP014LW012:~$ apt list --installed
Listing... Done
adduser/jammy,now 3.118ubuntu5 all [installed,automatic]
adwaita-icon-theme-full/jammy,now 41.0-1ubuntu1 all [installed]
adwaita-icon-theme/jammy,now 41.0-1ubuntu1 all [installed,automatic]
alsa-topology-conf/jammy,now 1.2.5.1-2 all [installed,automatic]
alsa-ucm-conf/jammy-updates,now 1.2.6.3-1ubuntu1.11 all [installed,automatic]
alsa-utils/jammy,now 1.2.6-1ubuntu1 amd64 [installed]
apparmor/jammy-updates,now 3.0.4-2ubuntu2.3 amd64 [installed,automatic]
@traversaro
traversaro / test_model.world
Created March 25, 2024 16:27
Minimum Working Example for a model that loads both gz-sim and gazebo classic plugins
<?xml version="1.0"?>
<sdf version="1.7">
<world name="example_world">
<model name="camera_model">
<static>true</static>
<pose>0 0 0.1 0 0 0</pose>
<link name="link">
<visual name="visual">
<geometry>
<box>
@traversaro
traversaro / .gitattributes
Last active March 21, 2024 11:28
Reproduce problem
# GitHub syntax highlighting
pixi.lock linguist-language=YAML
@traversaro
traversaro / reproduce.py
Last active December 13, 2023 12:08
Reproduce mujoco parsing problem
import mujoco
import tempfile
model_urdf_string = """
<?xml version="1.0" encoding="utf-8"?>
<!--Create with rod using build_cartpole_model.py -->
<robot name="cartpole">
<link name="cart">
<inertial>
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
@traversaro
traversaro / cartpole.urdf
Created December 13, 2023 11:03
MuJoCo parsing bug
<?xml version="1.0" encoding="utf-8"?>
<!--Create with rod using build_cartpole_model.py -->
<robot name="cartpole">
<link name="world"/>
<link name="rail">
<inertial>
<origin xyz="0.0 0.0 1.2" rpy="1.5707963267948963 0.0 0.0"/>
<mass value="5.0"/>
<inertia ixx="10.416697916666665" ixy="0.0" ixz="0.0" iyy="10.416697916666665" iyz="0.0" izz="6.25e-05"/>
</inertial>
@traversaro
traversaro / CMakeLists.txt
Created November 30, 2023 08:37
Test urdfdom
cmake_minimum_required(VERSION 3.12)
project(urdfdomTest)
find_package(urdfdom REQUIRED)
set(DUMMY_SOURCE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp")
file(WRITE ${DUMMY_SOURCE} "#include <iostream>\n\nint main() {\n std::cout << \"Hello, Dummy!\" << std::endl;\n return 0;\n}\n")
add_executable(dummy ${DUMMY_SOURCE})