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/bash | |
# Ref: https://github.com/J-Pai/EnvTrackerNode/tree/master | |
# Development setup including support for cross-compilation | |
# to AArch64, runtime dependencies and tools | |
sudo apt install python3 python3-dev python3-pip python3-venv \ | |
build-essential autoconf libtool bear \ | |
pkg-config cmake libssl-dev libsasl2-dev \ | |
openssl libcurl4-openssl-dev libc++-dev \ |
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
import os | |
import time | |
import math | |
import RTIMU | |
from copy import deepcopy | |
class IMUSensor: | |
def __init__(self, imu_settings_file='RTIMULib'): | |
self._imu_settings = self._get_settings_file(imu_settings_file) | |
self._imu = RTIMU.RTIMU(self._imu_settings) |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<dds> | |
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles"> | |
<participant profile_name="TailscaleDiscoveryServer" is_default_profile="true"> | |
<rtps> | |
<builtin> | |
<discovery_config> | |
<discoveryProtocol>SUPER_CLIENT</discoveryProtocol> | |
<discoveryServersList> | |
<RemoteServer prefix="44.53.00.5f.45.50.52.4f.53.49.4d.41"> |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles"> | |
<transport_descriptors> | |
<transport_descriptor> | |
<transport_id>TailscaleTransport</transport_id> | |
<type>UDPv4</type> | |
</transport_descriptor> | |
</transport_descriptors> | |
<participant profile_name="TailscaleSimple" is_default_profile="true"> | |
<rtps> |
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
# Copyright 2017 Open Source Robotics Foundation, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
# h = height/altitude of the sensor from ground | |
# fov = field of view of the sensor in radians | |
# res = resolution of the sensor in pixels | |
# scaler = scaling factor | |
# dt = time period of this loop | |
conversion_factor = h*2*np.tan(fov/2)/(res*scaler) | |
if 'paa5100': | |
# Convert data from sensor frame to ROS frame for PAA5100 |
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
from launch import LaunchDescription | |
from launch.actions import EmitEvent, RegisterEventHandler | |
from launch.events import matches_action | |
from launch_ros.actions import LifecycleNode | |
from launch_ros.event_handlers import OnStateTransition | |
from launch_ros.events.lifecycle import ChangeState | |
from lifecycle_msgs.msg import Transition | |
def generate_launch_description(): | |
ld = LaunchDescription() |
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
# The frequency, in Hz, at which the filter will output a position estimate. Note that the filter will not begin | |
# computation until it receives at least one message from one of the inputs. It will then run continuously at the | |
# frequency specified here, regardless of whether it receives more measurements. Defaults to 30 if unspecified. | |
frequency: 60 | |
# The period, in seconds, after which we consider a sensor to have timed out. In this event, we carry out a predict | |
# cycle on the EKF without correcting it. This parameter can be thought of as the minimum frequency with which the | |
# filter will generate new output. Defaults to 1 / frequency if not specified. | |
sensor_timeout: 0.05 |
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
void potential_fields() { | |
// these are the coordinates of the setpoint and the current position of the robot | |
// normally xr should be zero, equal to x0 (origin right in the center of the corridor) | |
// and y0 must have a value | |
float theta, phi, r = 1, Fatt_x, Fatt_y, Ftot_x, Ftot_y, Frep_x = 0, Frep_y = 0, Frep = 0, xr = 0, yr = 0, xs = 0.1, ys = 0; | |
Fatt_x = ws * (xs - xr); | |
Fatt_y = ws * (ys - yr); |
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
void adjust_LRF() { | |
for (unsigned int i = 0; i < scan.ranges.size(); ++i) { // i choose 0.01 because the invalid LRF are small negative and positive values | |
if (decision_variable == 1 || turning_left) { // left turn | |
if (i < 350) scan.ranges[i] = block_distance; | |
else if (scan.ranges[i] < 0.01 || scan.ranges[i] > radius_value || scan.ranges[i] != scan.ranges[i]) scan.ranges[i] = radius_value; | |
} | |
else if (decision_variable == 2 || turning_right) { // right turn | |
if (i > 650) scan.ranges[i] = block_distance; | |
else if (scan.ranges[i] < 0.01 || scan.ranges[i] > radius_value || scan.ranges[i] != scan.ranges[i]) scan.ranges[i] = radius_value; |
NewerOlder