반응형

Robot Operating System/Tutorial 따라하기 25

[Melodic][TF Tutorial] 6. Time travel with tf (Python)

1. Time travel $ roscd learning_tf $ nano ./nodes/turtle_tf_listener.py #!/usr/bin/env python import roslib roslib.load_manifest('learning_tf') import rospy import math import tf import geometry_msgs.msg import turtlesim.srv if __name__ == '__main__': rospy.init_node('turtle_tf_listener') listener = tf.TransformListener() rospy.wait_for_service('spawn') spawner = rospy.ServiceProxy('spawn', turt..

[Melodic][TF Tutorial] 5. Learning about tf and time (Python)

1. tf and Time In the previous tutorials we learned about how tf keeps track of a tree of coordinate frames. This tree changes over time, and tf stores a time snapshot for every transform (for up to 10 seconds by default). Until now we used the lookupTransform() function to get access to the latest available transforms in that tf tree, without knowing at what time that transform was recorded. Th..

[Melodic][TF Tutorial] 4. Adding a frame (Python)

Env. VMware workstation(Ubuntu 18.04 amd64, ROS Melodic) 1.Why adding frames 많은 경우, local frame을 사용하여 생각하는 것이 쉽다. 예를 들어, laser scan에 대해 추론하는 경우, laser scanner의 중심에 있는 프레임을 사용하는게 쉽다. tf는 각각의 sensor, link에 대해 local frame을 정의할 수 있게 하며, tf는 모든 프레임에 대한 transform을 관리해준다. 2. Where to add frames tf는 tree구조를 사용한다. 그리고 closed loop를 허용하지 않는다. 이 의미는 오직 하나의 parent만을 허용하고, 다수의 children을 가질 수 있다. 위의 그림에서는 3 fr..

[Melodic][TF Tutorial] 3. Writing a tf listener (Python)

Env. VMware workstation(Ubuntu 18.04 amd64, ROS Melodic) 1. How to create a tf listener $ roscd learning_tf $ nano ./nodes/turtle_tf_listener.py #!/usr/bin/env python import roslib roslib.load_manifest('learning_tf') import rospy import math import tf import geometry_msgs.msg import turtlesim.srv if __name__ == '__main__': rospy.init_node('turtle_tf_listener') listener = tf.TransformListener() r..

[Melodic][TF Tutorial] 2. Writing a tf broadcaster (Python)

Env. VMware workstation(Ubuntu 18.04 amd64, ROS Melodic) 0. Create package $ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/src $ catkin_create_pkg learning_tf tf roscpp rospy turtlesim $ cd .. $ catkin_make $ source ./devel/setup.bash 1. How to broadcast transforms $ roscd learning_tf $ mkdir nodes $ nano ./nodes/turtle_tf_broadcaster.py #!/usr/bin/env python import roslib roslib.load_manifest('lear..

[Melodic][TF Tutorial] 1. Introduction to tf

Env. VMware workstation(Ubuntu 18.04 amd64, ROS Melodic) 1. Set Up the Demo $ sudo apt-get install ros-melodic-ros-tutorials ros-melodic-geometry-tutorials ros-melodic-rviz ros-melodic-rosbash ros-melodic-rqt-tf-tree 2. Running the Demo # 1st termial $ roslaunch turtle_tf turtle_tf_demo.launch 두 거북이가 나타난다. turtle1(가운데 있는 거북이)를 화살표로 조정할 수 있으며(roslaunch를 실행한 terminal에 화살표 입력), turtle2(다른 거북이)가 따라간..

[Dashing][Client Libraries] 4. Writing a simple service and client (C++)

이 글은 아래의 자료를 참고로 만들어졌습니다. https://docs.ros.org/en/dashing/Tutorials/Writing-A-Simple-Cpp-Service-And-Client.html Writing a simple service and client (C++) — ROS 2 Documentation: Dashing documentation You're reading the documentation for a version of ROS 2 that has reached its EOL (end-of-life), and is no longer officially supported. If you want up-to-date information, please have a look at Galac..

[Dashing][Client Libraries] 3. Writing a simple publisher and subscriber (C++)

이 글은 아래의 자료를 참고로 만들어졌습니다. https://docs.ros.org/en/dashing/Tutorials/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html Writing a simple publisher and subscriber (C++) — ROS 2 Documentation: Dashing documentation Now there will be a new file named publisher_member_function.cpp. Open the file using your preferred text editor. 2.1 Examine the code The top of the code includes the standard C++ heade..

[Dashing][Client Libraries] 6. Using parameters in a class (Python)

이 글은 아래의 자료를 참고로 만들어졌습니다. https://docs.ros.org/en/dashing/Tutorials/Using-Parameters-In-A-Class-Python.html Using parameters in a class (Python) — ROS 2 Documentation: Dashing documentation Inside the dev_ws/src/python_parameters/python_parameters directory, create a new file called python_parameters_node.py and paste the following code within: 2.2 Add an entry point Open the setup.py file. Agai..

[Dashing][Client Libraries] 5. Creating custom ROS 2 msg and srv files (Python)

이 글은 아래의 자료를 참고로 만들어졌습니다. https://docs.ros.org/en/dashing/Tutorials/Custom-ROS2-Interfaces.html Creating custom ROS 2 msg and srv files — ROS 2 Documentation: Dashing documentation For this step you can use the packages you created in previous tutorials. A few simple modifications to the nodes, CMakeLists and package files will allow you to use your new interfaces. 7.1 Testing Num.msg with pub/s..

반응형