From 9d65a9730ea471800bb371d0788eafe55109cbeb Mon Sep 17 00:00:00 2001 From: Joshua Liu Date: Tue, 13 Dec 2022 20:42:15 -0500 Subject: [PATCH] Updated from Publii --- 404.html | 2 +- authors/joshua-liu/index.html | 2 +- authors/joshua-liu/page/2/index.html | 2 +- biblical-hebrew/index.html | 39 ++++++++ c-code-snippet/index.html | 4 +- c-learning-note/index.html | 4 +- cmake/index.html | 4 +- cpp/index.html | 4 +- create-ros-quick-source/index.html | 4 +- feed.json | 58 ++++++------ feed.xml | 128 +++++++++++---------------- gazebo-simulation/index.html | 4 +- genesis-1-in-hebrew/index.html | 39 ++++++++ index.html | 2 +- migrating-from-ros1/index.html | 4 +- motion-planning/index.html | 2 +- programming/index.html | 2 +- python/index.html | 4 +- pyvistatrimesh/index.html | 4 +- ros2-debuging/index.html | 2 +- ros2/index.html | 4 +- rtos/index.html | 2 +- search.html | 2 +- sitemap.xml | 8 ++ tags/biblical-hebrew/index.html | 23 +++++ tags/c/index.html | 2 +- tags/cheat-sheet/index.html | 2 +- tags/cmake/index.html | 2 +- tags/index.html | 2 +- tags/python/index.html | 2 +- tags/ros2/index.html | 2 +- 31 files changed, 222 insertions(+), 143 deletions(-) create mode 100644 biblical-hebrew/index.html create mode 100644 genesis-1-in-hebrew/index.html create mode 100644 tags/biblical-hebrew/index.html diff --git a/404.html b/404.html index 4186f70..18b9454 100644 --- a/404.html +++ b/404.html @@ -1,4 +1,4 @@ -Error 404 - Joshua Personal Notes

Go Home

Go Home

\ No newline at end of file diff --git a/c-code-snippet/index.html b/c-code-snippet/index.html index 8769912..5425102 100644 --- a/c-code-snippet/index.html +++ b/c-code-snippet/index.html @@ -1,4 +1,4 @@ -C++ Code Snippet - Joshua Personal Notes

C++ Code Snippet

Network

Acquire Localhost IP Address

#include <arpa/inet.h>
+C++ Code Snippet - Joshua Personal Notes        
         
 

C++ Code Snippet

Network

Acquire Localhost IP Address

#include <arpa/inet.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <linux/if.h>
@@ -376,7 +376,7 @@
 make -j8
 make install
 

1.注意cv::Mat()的宽高参数

前边是高,后边是宽,不要弄反了

Mat (int rows, int cols, int type);
-

C++ Learning Note

List

#include <list>
+C++ Learning Note - Joshua Personal Notes        
         
 

C++ Learning Note

List

#include <list>
 

In C++ lists are ordered sequences of variables of the same type. To initialize them we have to specify which type are the variables inside it. For example, for a list of integer values:

list<int> numbers_list({1,10,100,1000});
 

And a list of string values:

list<string> vocals_list( {"a","e","i","o","u"} );
 

The inconvenience with lists in C++ is that they are not as easy to print as in other languages. In this case we need to loop over all the items in a list to print them one by one. For now, here’s an example of printing a list:

for (int val : numbers_list)             // Loop
@@ -55,7 +55,7 @@
   float *laser_range_pointer = laser_range.data();
   return laser_range_pointer;
 }
-

This function called get_laser_full() is a function that returns a pointer (see the operator asterisk before the name of the class **RosbotClass**). What it does is take the values of a ROS vector called laser_range and assign them a pointer, then return this pointer.

CMake

CMake Reference/Tutorial

1. 指定第三方库的查找路径

可以使用CMAKE_PREFIX_PATH变量指定第三方库的查找路径(指定的安装路径)

cd build
+CMake - Joshua Personal Notes        
         
 

CMake

CMake Reference/Tutorial

1. 指定第三方库的查找路径

可以使用CMAKE_PREFIX_PATH变量指定第三方库的查找路径(指定的安装路径)

cd build
 cmake -DCMAKE_PREFIX_PATH=/Users/josh/my_install_dir ..
 make
 # OR
@@ -183,7 +183,7 @@
 func_name(abc)
 

输出

abc
 a;b;c
-

C++

C++ Resources

Tips

gcc linking

连接库编译的时候不要指定绝对路径,指定绝对路径可能在运行的时候找不到库文件

gcc -o demo /usr/lib/libceshi.so hello.o  #不要这样写,这样写放在别处运行可能找不到库文件
+C++ - Joshua Personal Notes        
         
 

C++

C++ Resources

Tips

gcc linking

连接库编译的时候不要指定绝对路径,指定绝对路径可能在运行的时候找不到库文件

gcc -o demo /usr/lib/libceshi.so hello.o  #不要这样写,这样写放在别处运行可能找不到库文件
 
gcc -o demo -L/usr/lib -lceshi  #这样写通用性比较好
-

绝对路径虽然申请设置环境变量步骤,但是缺陷也是致命的,这个so必须放在绝对路径下,不能放到其他地方,这样给部署带来很大麻烦。所以应该禁止使用绝对路径链接so

Setup Quick Source for ROS

Create .ros2rc or .ros1rc under your HOME folder for quick sourcing instead of source /opt/ros/.../setup.bash. Now you can just do:

source ~/.ros2rc
+Setup Quick Source for ROS - Joshua Personal Notes        
         
 

Setup Quick Source for ROS

Create .ros2rc or .ros1rc under your HOME folder for quick sourcing instead of source /opt/ros/.../setup.bash. Now you can just do:

source ~/.ros2rc
 

.ros2rc

#!/bin/sh
 # ROS2 stuff
 export ROS_DISTRO=humble
@@ -36,7 +36,7 @@
 
 source ~/.ros2rc
 export PYTHONPATH=~/miniconda3/envs/ros2/lib/python3.8/site-packages:/opt/ros/galactic/lib/python3.8/site-packages
-

Gazebo Simulation

Tutorials

Install

Spawn Urdf

Start by launching an empty world in Gazebo Sim:

ign sim empty.sdf
+Gazebo Simulation - Joshua Personal Notes        
         
 

Gazebo Simulation

Tutorials

Install

Spawn Urdf

Start by launching an empty world in Gazebo Sim:

ign sim empty.sdf
 

The following command spawns the URDF file rrbot.urdf into the Gazebo Sim world as a model named urdf_model:

ign service -s /world/empty/create --reqtype gz.msgs.EntityFactory --reptype gz.msgs.Boolean --timeout 1000 --req 'sdf_filename: "/home/josh/ros2_gazebo_ws/src/gazebo_ros_demos/rrbot_description/urdf/rrbot.urdf", name: "urdf_model"'
 

The Gui & Manipulating Models

Start by launching a sample world:

ign sim shapes.sdf
 

Topic

Publish a message to gazebo using command line:

gz topic -t /model/conveyor/link/section_0/track_cmd_vel --msgtype gz.msgs.Double -p data:10
-

Genesis 1 in Hebrew

Ch 1

v1-2

v3-5

v6-8

v9-10

v11-13

\ No newline at end of file diff --git a/index.html b/index.html index a38da10..15e6ae9 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ -Joshua Personal Notes

Featured Articles

  • Programming

    Cheat Sheet Updated on:

    Vim cheat sheet|Cheat Sheet (2) The Ultimate vimrc (Vim configuration) How to write a good README Add Table of Content Add Directory Structure Licensing and…

Featured Articles

  • Programming

    Cheat Sheet Updated on:

    Vim cheat sheet|Cheat Sheet (2) The Ultimate vimrc (Vim configuration) How to write a good README Add Table of Content Add Directory Structure Licensing and…

Migrating from ROS1

How-to: build ros-noetic on Ubuntu 22.04

Package manifests

CMakeLists.txt

  • Start by enabling C++14
set(CMAKE_CXX_STANDARD 14)
+Migrating from ROS1 - Joshua Personal Notes        
         
 

Migrating from ROS1

How-to: build ros-noetic on Ubuntu 22.04

Package manifests

CMakeLists.txt

  • Start by enabling C++14
set(CMAKE_CXX_STANDARD 14)
 
 find_package(ament_cmake REQUIRED)
 find_package(component1 REQUIRED)
@@ -8,7 +8,7 @@
 
 # At the bottom of the file:
 ament_package()
-

Code

  • geometry_msgs/msg/TransformStamped.msg
    • ROS1 #include <geometry_msgs/TransformStamped.h>
    • ROS2 #include <geometry_msgs/msg/transform_stamped.hpp>
      • When defining customized *.msg, should not use CamelCase, rather, should use camel_case.

Python

Collections

Libraries

  • cupoch - Robotics with GPU computing
  • kinpy -Simple kinematics calculation toolkit for robotics
  • PyTorch3D - provides efficient, reusable components for 3D Computer Vision research with PyTorch

Tutorials

Quick Notes

**pip install** From a Git Repository

python -m pip install git+https://github.com/django/django.git@main
+Python - Joshua Personal Notes        
         
 

Python

Collections

Libraries

  • cupoch - Robotics with GPU computing
  • kinpy -Simple kinematics calculation toolkit for robotics
  • PyTorch3D - provides efficient, reusable components for 3D Computer Vision research with PyTorch

Tutorials

Quick Notes

**pip install** From a Git Repository

python -m pip install git+https://github.com/django/django.git@main
 

**pip install** From a local dir

pip install -e /path/to/package
 
  • -e installs the package in a way, that you can edit the package, but it requires that the package source stay in the same place (/path/to/package in this case) forever.

**glob**通配符获取文件列表

glob.glob("./*.jpg")
 获取当前目录下的jpg文件列表
 

__init__.py的作用

参考链接 https://www.cnblogs.com/lands-ljk/p/5880483.html

__init__.py 文件的作用是将文件夹变为一个Python模块,Python 中的每个模块的包中,都有__init__.py 文件。

通常__init__.py 文件为空,但是我们还可以为它增加其他的功能。我们在导入一个包时,实际上是导入了它的__init__.py文件。这样我们可以在__init__.py文件中批量导入我们所需要的模块,而不再需要一个一个的导入。

当导入模块时,解释器按照sys.path列表中的目录顺序来查找导入文件。

import sys
 print(sys.path)
 

Other Tools

Issues

编译ros提示缺少em模块

python3 -m pip install empy
-

PyVista/Trimesh

Conversion

Pyvista to Trimesh

Convert Pyvista 1-D face array to Trimesh faces

def pyvistaToTrimeshFaces(cells):
+PyVista/Trimesh - Joshua Personal Notes        
         
 

PyVista/Trimesh

Conversion

Pyvista to Trimesh

Convert Pyvista 1-D face array to Trimesh faces

def pyvistaToTrimeshFaces(cells):
     faces = []
     idx = 0
     while idx < len(cells):
@@ -316,7 +316,7 @@
 
 if __name__ == "__main__":
     QVTKRenderWidgetConeExample(sys.argv)
-

ROS2

ROS Stuff

ROS2_Control

MoveIt 2

Hardware

Simulation

Other


ROS Note

rosdep

Resolving workspace package dependencies

Go to the top directory of your colcon/catkin workspace where the source code of the ROS packages you’d like to use are. Then run:

rosdep install --from-paths src --ignore-src -r -y --rosdistro humble
+ROS2 - Joshua Personal Notes        
         
 

ROS2

ROS Stuff

ROS2_Control

MoveIt 2

Hardware

Simulation

Other


ROS Note

rosdep

Resolving workspace package dependencies

Go to the top directory of your colcon/catkin workspace where the source code of the ROS packages you’d like to use are. Then run:

rosdep install --from-paths src --ignore-src -r -y --rosdistro humble
 

This command magically installs all the packages that the packages in your catkin workspace depend upon but are missing on your computer. You can also --skip-keys “pkg_name”

Pure Python Packages

In the package.xml add:

<exec_depend>python3-package_name-pip</exec_depend>
 

ros2 service/param

To see the types of all the active services:

ros2 service list -t
 

Load parameter file on node startup:

ros2 run <package_name> <executable_name> --ros-args --params-file <file_name>
 

Other Tools

image_tools

To stream camera view, use:

ros2 run image_tools showimage image:=/camera/color/image_raw
-
\ No newline at end of file diff --git a/tags/c/index.html b/tags/c/index.html index 88041d8..ef2eb3a 100644 --- a/tags/c/index.html +++ b/tags/c/index.html @@ -1,4 +1,4 @@ -Tag: C++ - Joshua Personal Notes
  • C++ Learning Note

    List #include <list> In C++ lists are ordered sequences of variables of the same type. To initialize them we have to specify which type are…

  • C++ Code Snippet

    Network Acquire Localhost IP Address #include <arpa/inet.h> #include <sys/ioctl.h> #include <sys/types.h> #include <linux/if.h> #include <net/if_arp.h> #include <unistd.h> #include <linux/sockios.h> #include <linux/ethtool.h> #include <cstring> #include <cassert>…

  • CMake

    CMake Reference/Tutorial Step 2: Adding a Library Step 3: Adding Usage Requirements for a Library Step 4: Installing and Testing Step 9: Selecting Static or…

  • C++

    C++ Resources C++ Core Guidelines C++ Programming (GeeksforGeeks) Google C++ Style Guide ROS2 C++ Code Style Modern C++ Programming (Slides) Tips for Optimizing C/C++ Code…

  • C++ Learning Note

    List #include <list> In C++ lists are ordered sequences of variables of the same type. To initialize them we have to specify which type are…

  • C++ Code Snippet

    Network Acquire Localhost IP Address #include <arpa/inet.h> #include <sys/ioctl.h> #include <sys/types.h> #include <linux/if.h> #include <net/if_arp.h> #include <unistd.h> #include <linux/sockios.h> #include <linux/ethtool.h> #include <cstring> #include <cassert>…

  • CMake

    CMake Reference/Tutorial Step 2: Adding a Library Step 3: Adding Usage Requirements for a Library Step 4: Installing and Testing Step 9: Selecting Static or…

  • C++

    C++ Resources C++ Core Guidelines C++ Programming (GeeksforGeeks) Google C++ Style Guide ROS2 C++ Code Style Modern C++ Programming (Slides) Tips for Optimizing C/C++ Code…

  • Programming

    Vim cheat sheet|Cheat Sheet (2) The Ultimate vimrc (Vim configuration) How to write a good README Add Table of Content Add Directory Structure Licensing and…

  • Programming

    Vim cheat sheet|Cheat Sheet (2) The Ultimate vimrc (Vim configuration) How to write a good README Add Table of Content Add Directory Structure Licensing and…

  • CMake

    CMake Reference/Tutorial Step 2: Adding a Library Step 3: Adding Usage Requirements for a Library Step 4: Installing and Testing Step 9: Selecting Static or…

  • CMake

    CMake Reference/Tutorial Step 2: Adding a Library Step 3: Adding Usage Requirements for a Library Step 4: Installing and Testing Step 9: Selecting Static or…

  • PyVista/Trimesh

    Conversion Pyvista to Trimesh Convert Pyvista 1-D face array to Trimesh faces def pyvistaToTrimeshFaces(cells): faces = [] idx = 0 while idx < len(cells): curr_cell_count…

  • Python

    Collections PythonRobotics Comprehensive Python Cheatsheet Problem Solving with Python Scipy Lecture Notes Github: https://github.com/scipy-lectures/scipy-lecture-notes PythonTemplate Python Template is a Cookiecutter template for creating a python…

  • PyVista/Trimesh

    Conversion Pyvista to Trimesh Convert Pyvista 1-D face array to Trimesh faces def pyvistaToTrimeshFaces(cells): faces = [] idx = 0 while idx < len(cells): curr_cell_count…

  • Python

    Collections PythonRobotics Comprehensive Python Cheatsheet Problem Solving with Python Scipy Lecture Notes Github: https://github.com/scipy-lectures/scipy-lecture-notes PythonTemplate Python Template is a Cookiecutter template for creating a python…

  • Motion Planning

    Tesseract Robotics | Optimization Motion Planning Tesseract wiki — Industrial Training documentation Optimal Control for Robotics

  • RTOS

    FreeRTOS RTOS Basics: Getting Started with Microcontrollers Comparison between RTOSes Introduction to RTOS (Youtube Playlist) eProsima: RTPS/DDS Experts, the middleware experts BriscoeTech/Arduino-FreeRTOS-SAMD51: A port of…

  • Migrating from ROS1

    How-to: build ros-noetic on Ubuntu 22.04 set(CMAKE_CXX_STANDARD 14) find_package(ament_cmake REQUIRED) find_package(component1 REQUIRED) # ... find_package(componentN REQUIRED) # At the bottom of the file: ament_package() Code…

  • ROS2 Debuging

    VSCode Microsoft VScode Extension for ROS Debugging ROS C++ nodes VSCode ROS2 Workspace Template VScode debug ROS cpp 程序设置 断点调试

  • Gazebo Simulation

    Gazebo Garden ros_gz, Integration between ROS and Gazebo simulation gz_ros2_control Only works with gazebo fortress, not with garden yet Tutorials Install Ubuntu Source Install(Garden) Spawn…

  • Setup Quick Source for ROS

    Create .ros2rc or .ros1rc under your HOME folder for quick sourcing instead of source /opt/ros/.../setup.bash. Now you can just do: source ~/.ros2rc .ros2rc #!/bin/sh #…

  • ROS2

    ROS Stuff ROS Discourse ROS to ROS2 Porting Guide The Robotics Back-End (ROS2 Tutorials) ROS2 YAML For Parameters In this tutorial you will see how…

  • Motion Planning

    Tesseract Robotics | Optimization Motion Planning Tesseract wiki — Industrial Training documentation Optimal Control for Robotics

  • RTOS

    FreeRTOS RTOS Basics: Getting Started with Microcontrollers Comparison between RTOSes Introduction to RTOS (Youtube Playlist) eProsima: RTPS/DDS Experts, the middleware experts BriscoeTech/Arduino-FreeRTOS-SAMD51: A port of…

  • Migrating from ROS1

    How-to: build ros-noetic on Ubuntu 22.04 set(CMAKE_CXX_STANDARD 14) find_package(ament_cmake REQUIRED) find_package(component1 REQUIRED) # ... find_package(componentN REQUIRED) # At the bottom of the file: ament_package() Code…

  • ROS2 Debuging

    VSCode Microsoft VScode Extension for ROS Debugging ROS C++ nodes VSCode ROS2 Workspace Template VScode debug ROS cpp 程序设置 断点调试

  • Gazebo Simulation

    Gazebo Garden ros_gz, Integration between ROS and Gazebo simulation gz_ros2_control Only works with gazebo fortress, not with garden yet Tutorials Install Ubuntu Source Install(Garden) Spawn…

  • Setup Quick Source for ROS

    Create .ros2rc or .ros1rc under your HOME folder for quick sourcing instead of source /opt/ros/.../setup.bash. Now you can just do: source ~/.ros2rc .ros2rc #!/bin/sh #…

  • ROS2

    ROS Stuff ROS Discourse ROS to ROS2 Porting Guide The Robotics Back-End (ROS2 Tutorials) ROS2 YAML For Parameters In this tutorial you will see how…