This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.20) | |
project(python_module) | |
find_package(Python3 COMPONENTS Development.Module) | |
#Python_add_library(hello MODULE hello.c) | |
add_library(hello SHARED hello.c) | |
target_include_directories(hello PRIVATE ${Python_INCLUDE_DIRS}) | |
target_link_libraries(hello Python3::Module) | |
set_target_properties(hello PROPERTIES PREFIX "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When you build ROS by yourself, do NOT have multiple version of | |
# Python development packages (libpython3.XX-dev). | |
# | |
# Because packages in ROS use either | |
# | |
# find_package(Python3 REQUIRED COMPONENTS Development) | |
# or | |
# find_package(Python3 REQUIRED COMPONENTS Interpreter) | |
# | |
# These two give you a different version if you have a different |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <boost/accumulators/accumulators.hpp> | |
#include <boost/accumulators/statistics.hpp> | |
#include <boost/accumulators/statistics/rolling_mean.hpp> | |
#include <boost/accumulators/statistics/stats.hpp> | |
namespace ba = boost::accumulators; | |
int main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int _zbus_message_acc_data_chan = { 42 }; | |
static struct zbus_channel_data _zbus_chan_data_acc_data_chan = { | |
.observers_start_idx = -1, | |
.observers_end_idx = -1 | |
}; | |
static struct k_mutex _zbus_mutex_acc_data_chan = { | |
.wait_q = { { {(&(&_zbus_mutex_acc_data_chan.wait_q)->waitq)}, {(&(&_zbus_mutex_acc_data_chan.wait_q)->waitq)} } }, | |
.owner = NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <zephyr/kernel.h> | |
#include <zephyr/logging/log.h> | |
#include <zephyr/zbus/zbus.h> | |
LOG_MODULE_REGISTER(app); | |
ZBUS_CHAN_DEFINE(acc_data_chan, | |
int, | |
NULL, | |
NULL, /* User data */ | |
ZBUS_OBSERVERS(my_listener, my_subscriber), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int foo(void) | |
{ | |
return 42; | |
} | |
int main(void) | |
{ | |
int val = { | |
foo() | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&spi4 { | |
pinctrl-0 = <&spi4_sck_pe2 &spi4_miso_pe5 &spi4_mosi_pe6>; | |
pinctrl-names = "default"; | |
cs-gpios = <&gpioe 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; | |
status = "okay"; | |
}; | |
&spi4_sck_pe2 { | |
bias-pull-up; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# (C) Copyright 2023 Space Cubics, LLC | |
# | |
# Make the next line a comment line for TCL \ | |
exec vivado -mode batch -nolog -nojournal -notrace -tempDir $(mktemp -d /tmp/vivado.XXXXXXXXXX) -source "$0" -tclargs ${1+"$@"} | |
set cfgmem_mode [string match "*cfgmem*" $argv0] | |
# Set device parameter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat a.c | |
#include <stdint.h> | |
uint16_t GetTimer(void); | |
void delay_us(uint16_t dt) { | |
uint16_t t1 = GetTimer(); | |
uint16_t t2 = GetTimer() - t1; | |
while (t2 < dt) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gdb -p $(pidof rviz2) | |
GNU gdb (Debian 12.1-4+b1) 12.1 | |
Copyright (C) 2022 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. | |
Type "show copying" and "show warranty" for details. | |
This GDB was configured as "x86_64-linux-gnu". | |
Type "show configuration" for configuration details. | |
For bug reporting instructions, please see: |
NewerOlder