This file contains hidden or 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
ROS Marker publisher: | |
Step 1: Transform Yaml file into Python dict notation. | |
Alternative 1, online tool: | |
A useful tool which will shows the result in Python notation of any YAML input is: | |
https://yaml-online-parser.appspot.com/ | |
Make sure to remove excess single quotes (') and new lines. | |
Alternative 2, use a python : |
This file contains hidden or 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
# Allow for ROS source choice, paste this it in the user configuration file (.bashrc) | |
read -p "Do you want to source the ros_ws workspace in this new terminal window? (y/n): " input_choice | |
if [ "$input_choice" = "y" ] | |
then | |
echo "ROS sourced!" | |
# Source the distro specific setup file | |
source /opt/ros/kinetic/setup.bash | |
# Change ROS editor to nano | |
export EDITOR='nano -w' |
This file contains hidden or 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> | |
float remap(float fromValue, float fromMin, float fromMax, float toMin, float toMax) | |
{ | |
float fromAbs = fromValue - fromMin; | |
float fromMaxAbs = fromMax - fromMin; | |
float normal = fromAbs / fromMaxAbs; | |
float toMaxAbs = toMax - toMin; |
This file contains hidden or 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 "least_squares.h" | |
#include <math.h> | |
/**************************************************************************** | |
Least squares fit of circle to set of points. | |
by Dave Eberly ([email protected] or [email protected]) | |
ftp://ftp.cs.unc.edu/pub/users/eberly/magic/circfit.c | |
--------------------------------------------------------------------------- | |
Input: (x_i,y_i), 1 <= i <= N, where N >= 3 and not all points | |
are collinear |
This file contains hidden or 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
<!-- By default, start RViz --> | |
<arg name="rviz" default="true" /> | |
<!-- Run Rviz and load the default config to see the state of the move_group node --> | |
<include file="$(find package)/launch/moveit_rviz.launch"> | |
<include if="$(arg rviz)" file="$(find package)/launch/moveit_rviz.launch"> | |
<arg name="config" value="true"/> | |
<arg name="debug" value="$(arg debug)"/> | |
</include> |
This file contains hidden or 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
0. First check what is the output of "echo $GAZEBO_MODEL_PATH" | |
What is the output of "echo $GAZEBO_MODEL_PATH"? | |
1. Run from command line to grant access to models once: | |
(Tip: cd to the ros package with roscd, then use pwd command to get the full path) | |
export GAZEBO_MODEL_PATH=~/simulation_ws/src/logistic_demo_sim/models:$GAZEBO_MODEL_PATH | |
2. To permanently enable Gazebo to locate gazebo model files (SDF's): |
This file contains hidden or 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"?> | |
<robot name="cham_bot"> | |
<link name="z_axis"> | |
<visual> | |
<geometry> | |
<box size="0.2 0.2 6.5"/> | |
</geometry> | |
<origin rpy="0 0 0" xyz="0.25 0 7"/> |
This file contains hidden or 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
#!/usr/bin/python | |
################################################################# | |
##\file | |
# | |
# \note | |
# Copyright (c) 2010 \n | |
# Fraunhofer Institute for Manufacturing Engineering | |
# and Automation (IPA) \n\n | |
# | |
################################################################# |
This file contains hidden or 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
def one_hot_encode(labels): | |
""" | |
One hot encode a list of sample labels. Return a one-hot encoded vector for each label. | |
: x: List of sample Labels | |
: return: Numpy array of one-hot encoded labels | |
""" | |
# TODO: Implement Function | |
depth = 10 | |
one_hot = np.eye(depth)[labels] | |
This file contains hidden or 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
def normalize_grayscale(image_data): | |
""" | |
Normalize the image data with Min-Max scaling to a range of [0.1, 0.9] | |
:param image_data: The image data to be normalized | |
:return: Normalized image data | |
""" | |
# Implement Min-Max scaling for grayscale image data | |
a = 0.1 | |
b = 0.9 | |
grayscale_min = 0 |