Skip to content

Instantly share code, notes, and snippets.

@marcoesposito1988
marcoesposito1988 / catkin.autosource.fish
Created October 1, 2019 08:39
fish function to automatically source a catkin source when cding into it, set up rosfish and workarounds for issues with ROS melodic and Kubuntu 18.04
# inspired from https://yodahuang.github.io/articles/How-to-let-ROS-play-happily-with-fish/
# added detection of catkin workspaces generated with catkin-tools
# added workaround for numeric issues with ROS melodic when the locale is not English https://github.com/ros-visualization/rviz/issues/1249#issuecomment-403351217
# added workaround for Rviz displaying in only a portion of the screen https://github.com/ros-visualization/rviz/issues/1203#issuecomment-438213723
function catkinSource --on-variable PWD
status --is-command-substitution; and return
if test -e ".catkin_workspace" -o -d ".catkin_tools"
bass source devel/setup.bash
@marcoesposito1988
marcoesposito1988 / bag_tf_static_to_tf.py
Created September 24, 2019 10:22
Make /tf_static usable in rosbags
import rospy
import rosbag
inpath = '/path/to/original/bag.bag'
outpath = '/path/to/output/bag.bag'
trigger = lambda topic, msg, _: topic == '/tf' and msg.transforms[0].header.frame_id == '/world'
inbag = rosbag.Bag(inpath)
tf_static_messages = list(inbag.read_messages(('/tf_static')))