This is a small tutorial on how to debug a ROS2 C++ node usign VSCode.
This implementation was done using:
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
| usage() { | |
| cat <<EOF | |
| Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
Table of Contents:
| // Copyright 2019 Google LLC. | |
| // SPDX-License-Identifier: Apache-2.0 | |
| // Polynomial approximation in GLSL for the Turbo colormap | |
| // Original LUT: https://gist.github.com/mikhailov-work/ee72ba4191942acecc03fe6da94fc73f | |
| // Authors: | |
| // Colormap Design: Anton Mikhailov ([email protected]) | |
| // GLSL Approximation: Ruofei Du ([email protected]) |
| #!/usr/bin/env python3 | |
| import rospy | |
| import urllib.request | |
| import urllib.error | |
| import socket | |
| import os | |
| # This is not a param to avoid param injection | |
| # or unexpected programm killed because of a simple rosparam set with a wrong value |
| #include <stdio.h> // printf, sprintf, fprintf | |
| #include <stdlib.h> // malloc | |
| int main() { | |
| const unsigned char bytearr[] = { 0x12, 0x34, 0x56, 0x78 }; | |
| const size_t arrlen = sizeof(bytearr); | |
| const size_t hexlen = 2; // hex representation of byte with leading zero | |
| const size_t outstrlen = arrlen * hexlen; | |
| char * outstr = malloc(outstrlen + 1); |
| import logging | |
| import paramiko | |
| class SSH: | |
| def __init__(self): | |
| pass | |
| def get_ssh_connection(self, ssh_machine, ssh_username, ssh_password): | |
| """Establishes a ssh connection to execute command. | |
| :param ssh_machine: IP of the machine to which SSH connection to be established. |
| cmake_minimum_required(VERSION 3.8) | |
| project(tsProject) | |
| # Managing translations require LinguistTools module | |
| # The cmake function is defined in the Qt installation tree: | |
| # i.e. Qt5.9.1/5.9.1/gcc_64/lib/cmake/Qt5LinguistTools/Qt5LinguistToolsMacros.cmake | |
| # Reference: https://doc.qt.io/qt-5/cmake-manual.html#qt5linguisttools-macros | |
| find_package(Qt5 COMPONENTS Widgets LinguistTools) | |
| set (CMAKE_CXX_STANDARD 11) | |
| set(CMAKE_INCLUDE_CURRENT_DIR ON) |