Skip to content

Instantly share code, notes, and snippets.

View mxgrey's full-sized avatar
🦀
Rustacean

Grey mxgrey

🦀
Rustacean
View GitHub Profile
@mxgrey
mxgrey / generic_systems.rs
Last active August 7, 2024 14:42
Bevy IntoSystem refusing to accept a system with a generic SystemParam
use bevy::{
prelude::*,
ecs::system::SystemParam,
};
fn main() {
let mut app = App::new();
// Works
app.add_systems(Update, system_without_generic);
// Works
<?xml version="1.0" encoding="utf-8"?>
<sdf version="1.7">
<world name="hotel">
<include>
<uri>model://CleanerBotA</uri>
<name>cleanerBotA_2</name>
<static>false</static>
<pose>28.980213 -27.447807 0 0 0 0</pose>
</include>
<include>
pipenv-install install$ pipenv install -d --site-packages
│ Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. …
│ Installing dependencies from Pipfile.lock (9ef4b3)...
│ Installing dependencies from Pipfile.lock (9ef4b3)...
│ [pipenv.exceptions.InstallError]: Ignoring ruamel.yaml.clib: markers 'platform_python_implementation == "CPython" and python_version < "3.11"' don't match your environ…
│ [pipenv.exceptions.InstallError]: Ignoring tomli: markers 'python_full_version < "3.11.0a7"' don't match your environment
│ [pipenv.exceptions.InstallError]: Collecting aiofiles==0.8.0 (from -r /tmp/pipenv-mzuexqic-requirements/pipenv-d0ap2win-hashed-reqs.txt (line 1))
│ [pipenv.exceptions.InstallError]: Using cached aiofiles-0.8.0-py3-none-any.whl (13 kB)
│ [pipenv.exceptions.InstallError]: Collecting aiosqlite==0.17.0 (from -r /tmp/pipenv-mzuexqic-requirements/pipenv-d0ap2win-hashed-reqs.txt (line 2))
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 267, in run_setup
exec(code, g)
File "<string>", line 9, in <module>
ModuleNotFoundError: No module named 'numpy.distutils'
[0.751s] ERROR:colcon.colcon_core.package_identification:Exception in package identification extension 'python_setup_py' in 'venv/lib/python3.12/site-packages/numpy/_typing': Command '['/usr/bin/python3', '-c', 'import sys;from contextlib import suppress;exec("with suppress(ImportError): from setuptools.extern.packaging.specifiers import SpecifierSet");exec("with suppress(ImportError): from packaging.specifiers import SpecifierSet");from distutils.core import run_setup;dist = run_setup( \'setup.py\', script_args=(\'--dry-run\',), stop_after=\'config\');skip_keys = (\'cmdclass\', \'distclass\', \'ext_modules\', \'metadata\');data = { key: value for key, value in dist.__dict__.items() if ( not key.startswith(\'
#!/bin/bash
success_counter=0
failure_counter=0
mkdir failures
while [ $failure_counter -lt 100 ]
do
clear
echo "=============== $RMW_IMPLEMENTATION | Failures: $failure_counter | Successes: $success_counter =========================="
"$@" &> failures/tmp.txt
@mxgrey
mxgrey / cmake_install.cmake
Created March 19, 2024 18:37
bad resource generation
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/ament_index/resource_index/rust_packages" TYPE FILE FILES "/usr/local/google/home/mxgrey/projects/ros2-rolling/build/libstatistics_collector/ament_cmake_index/share/ament_index/resource_index/rust_packages/libstatistics_collector")
endif()
@mxgrey
mxgrey / gist:b7a8ede7075cf7764e622ce8e2996888
Created February 28, 2024 02:46
cancellation_test.json
{
"phases": [
{
"activity": {
"category": "go_to_place",
"description": "hardware_2"
},
"on_cancel": [
{
"category": "go_to_place",
ros2 launch rmf_demos_gz_classic office.launch.xml
[INFO] [launch]: All log files can be found below /home/krms/.ros/log/2024-01-29-14-19-10-683060-krms-115814
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [rmf_traffic_schedule-1]: process started with pid [115816]
[INFO] [rmf_traffic_blockade-2]: process started with pid [115818]
[INFO] [building_map_server-3]: process started with pid [115820]
[INFO] [schedule_visualizer_node-4]: process started with pid [115822]
[INFO] [fleetstates_visualizer_node-5]: process started with pid [115824]
[INFO] [rmf_visualization_building_systems-6]: process started with pid [115826]
[INFO] [navgraph_visualizer_node-7]: process started with pid [115828]
@mxgrey
mxgrey / main.rs
Last active December 11, 2023 15:16
Draft of proposed API usage for async rclrs
fn main() {
// BasicExecutor will be the executor that we provide out-of-the-box from rclrs.
// Using the plain new() constructor for BasicExecutor will create a Context using
// the user's command line arguments.
let mut executor = rclrs::BasicExecutor::new();
// String-like types can be automatically converted into NodeOptions.
let node = executor.create_node("mobility");
// Create a "worker" that manages some data that callbacks associated with this worker
@mxgrey
mxgrey / weird.rs
Last active March 6, 2023 15:11
Strange bug where outlines diverge from their object
use bevy::{
prelude::*,
render::mesh::shape::{Box, UVSphere},
window::close_on_esc,
};
use bevy_mod_outline::*;
#[bevy_main]
fn main() {