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
<!-- 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
#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
#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
# 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
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
#!/usr/bin/env python | |
""" | |
Rviz point cloud visualization marker example | |
Author: Roberto Zegers R. | |
Copyright: Copyright (c) 2021, Roberto Zegers R. | |
License: BSD-3-Clause | |
Date: March 2021 | |
""" |
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
"""Launch Gazebo server and client with command line arguments.""" | |
from launch import LaunchDescription | |
from launch.actions import ExecuteProcess | |
def generate_launch_description(): | |
return LaunchDescription([ |
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
"""Launch Gazebo server and client via include and launch the gazebo.launch.py file.""" | |
import os | |
from launch import LaunchDescription | |
from launch.actions import IncludeLaunchDescription | |
from launch.launch_description_sources import PythonLaunchDescriptionSource | |
from ament_index_python.packages import get_package_share_directory | |
def generate_launch_description(): |
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/python3 | |
# -*- coding: utf-8 -*- | |
import os | |
from ament_index_python.packages import get_package_share_directory | |
from launch import LaunchDescription | |
from launch.actions import DeclareLaunchArgument | |
from launch.actions import IncludeLaunchDescription | |
from launch.launch_description_sources import PythonLaunchDescriptionSource |