Skip to content

Instantly share code, notes, and snippets.

@kor01
kor01 / ext_setup.py
Created April 12, 2017 11:25
[create extension]build a cython extension #tags: cython
from Cython.Build import cythonize
from distutils.core import setup, Extension
ext = Extension(name="wrap_fib",
sources=["cfib.c", "wrap_fib.pyx”])
setup(ext_modules=cythonize(ext))
@kor01
kor01 / tf_add_frame.py
Last active June 24, 2017 00:58
[tf_add_frame] add a new frame #tf #ros
#!/usr/bin/env python
import roslib
roslib.load_manifest('learning_tf')
import rospy
import tf
if __name__ == '__main__':
rospy.init_node('my_tf_broadcaster')
br = tf.TransformBroadcaster()
@kor01
kor01 / ros_fs.sh
Last active June 26, 2017 13:08
[ros filesystem] #ros
rospack find [package_name]
rospack find roscpp
# goto package directory
roscd roscpp
# go to log directory
roscd log
# list dir
@kor01
kor01 / CMakeLists.txt
Last active June 26, 2017 13:08
[ros workspace] #ros
to be added
@kor01
kor01 / install_deps.sh
Last active June 26, 2017 22:25
[ros deps] retrieve package deps #ros
# install all dependencies of a package
rosdep install my_package
@kor01
kor01 / auto_fill_message_header.txt
Last active June 26, 2017 13:08
[ros build] #ros
# Standard metadata for higher-level stamped data types.
# This is generally used to communicate timestamped data
# in a particular coordinate frame.
#
# sequence ID: consecutively increasing ID
uint32 seq
#Two-integer timestamp that is expressed as:
# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
# time-handling sugar is provided by the client library
@kor01
kor01 / message_basics.sh
Last active August 16, 2019 20:12
[ros msg] ros message #ros
# show message definition
rosmsg show sensor_msgs/CameraInfo
# show message type
rostopic type rosout
# quick message definition view
rostopic type rosout | rosmsg show
# echo message live content
@kor01
kor01 / nodes_basics.sh
Last active June 26, 2017 13:28
[ros nodes] ros nodes #ros
# start ros master + rosout + ps
roscore
# list all the running nodes
rosnode list
# get information
rosnode info /rosout
# run ros node
@kor01
kor01 / param_basics.sh
Last active July 4, 2017 23:45
[ros topic service] #ros
# list parameter
rosparam list
# set parameter
rosparam set parameter_name
rosparam set /background_r 150
# get parameter
rosparam get /background_g
@kor01
kor01 / my_launch.launch
Created June 26, 2017 13:58
[ros launch] launch files an rqt_console #ros
<launch>
<group ns="turtlesim1">
<node pkg="turtlesim" name="sim" type="turtlesim_node"/>
</group>
<group ns="turtlesim2">
<node pkg="turtlesim" name="sim" type="turtlesim_node"/>
</group>