for Robot Artificial Inteligence

How to create a ROS2 Package for python

|

COMMANDS TO USE:

  • source /opt/ros/crystal/setup.bash
  • ros2 pkg create ros2_msg –build-type ament_cmake –dependencies rclcpp std_msgs
  • create msg folder
  • create msg file as Mymsg.msg
  • then write messages
int32 day
string month
int year
  • CMakeLists에다 find_package(rosidl_default_generators REQQUIRED), find_package(builtin_interface REQUIRED) 추가
  • 그리고 rosidl_generate_interface(new_msg “msg/Mymsg.msg” DEPENDENCIES builtin_interface) 추가
  • 마지막으로 package.xml 파일도 추가
    • builtin_interface
    • rosidl_default_generators
    • builtin_interface
    • rosidl_default_runtime
    • rosidl_interface_package
  • 그리고 concon build –symlink-install
  • source install/setup.bash

Test

  • ros2 topic pub /test_topic ros2_msg/MyMsg “{day : ‘21’, month : ‘August’, year : ‘2021’ }”

로스2 에서는 msg, serve, action등의 메세지들 중복에 대한 충볼을 프리하게 하였다.

참고 자료: https://www.youtube.com/watch?v=nG3IOkEOPps&list=PLK0b4e05LnzYNBzqXNm9vFD9YXWp6honJ&index=3

Comment  Read more

How to Publish & Subscribe to a ROS2 topic

|

COMMANDS TO USE:

  • ros2 topic list
  • ros2 msg list
  • ros2 msg show std_msgs/String
  • ros2 topic pub /chatter std_msgs/String “data: Hello ROS Developers”
  • ros2 topic echo /chatter

it is quite similar to ROS1

  • ros2 topic pub



Comment  Read more

How to launch a ROS2 Node

|

COMMANDS TO USE:

  • ros2 run
  • ros2 pkg list
  • ros2 pkg executables

FOR EXAMPLE

  • ros2 run semantic_SLAM ekf_publisher.

then, it executes the node.

이전에는 익세큐트 하나에 노드 하나였는데, 로스2부터는 익세큐트에 여러 노드가 가능하다.



Comment  Read more

중국 평수와 한국 평수 차이

|

중국 부동산에 가면 30평 45평 집이 상해 기준 3000~5000원 월세인것을 알 수 있다. 한국 기준으로 30평 45평으로 생각하고 집을 구경하러 가면, 생각했던것 보다 코딱지만 한 집인걸 알 수 있다.

중국과 한국이 말하는 평수가 다른 이유는

중국은 1m^2 면적 단위로 1평이라고 부른다.

반면에

한국은 3.3m^2 면적 단위로 1평이라고 부른다.

이유는 아래 링크를 보면 될 것 같다.

https://kin.naver.com/qna/detail.nhn?d1id=11&dirId=1119&docId=381962610&qb=7J2867O4IDHtj4kg66m07KCB&enc=utf8&section=kin.ext&rank=1&search_sort=0&spq=0

즉, 방을 구할때 대략 1/3을 하면 우리나라 평수로 이해하기 쉽다.



Comment  Read more

리눅스에서 bashrc file, Shell, 커맨드 Source, Export의미

|

Bashrc file

Bashrc file is a script file that’s executed when a user logs in. the file itself contains a series of configuration for the terminal session. this includes setting up or enabling: coloring, completion, shell history, command aliases, and more. it is a hidden file and simple is command won’t show the file.s

~/.bashrc는 alias와 bash가 수행될 때 실행되는 함수를 제어하는 지역적인 시스템 설정 관련 파일이다. 이들 alias와 함수들은 오직 그 사용자에게만 한정되며, 그 이외의 다른 사람에게 영향을 미치지 않는다.

Shell

the shell is an interactive interace that allows users to execute other commands and utilites in linux and other unix-based operating systems. when you login to the operating system, the standard shell is displayed and allow you perform common operations such as copy files or restart the system.

  • on most linux systems a program called bash (which stands for bourne Again shell, an enhanced version of the original Unix shell program, sh) acts as the shell program.

Source

Source is a shell built-in command which is used to read and execute the content of file(generally set of commands), passed as an argument in the current shell script. the Command after taking the content of the specified files passed it to the TCL interpreter as text script which then gets executed

  • TCL interpreter is a high-level, general-purpose, interpreted, dynamic programming language. it is available for many operating system, allowing tcl code to run on a wide variety of systems.

source 명령어는 스크립트 파일을 수정한 후에 수정된 값을 바로 적용하기 위해 사용하는 명령어 이다. 예를들어 etc/bashrc 파일을 수정 후 저장하여도 수정한 내용이 바로 적용 되지 않는다. source 명령어를 통해 적용할수 있다.

Export

the export command is a built-in utility of Linux Bash shell. it is used to ensure the environment variables and functions to be passed to child processes. the export command allow us to update the current session about the changes that have been made to the exported variables.

export 는 설정하고자 하는 변수를 환경변수로 등록할 때 쓴다.

Comment  Read more