Logging custom uORB message for simulation

Hi,

I am trying to log my custom uORB message in a simulation using ROS. The logger.cpp looks in

PX4_ROOTFSDIR "/fs/microsd/etc/logging/logger_topics.txt"

for the file logger_topics.txt. The problem is I tried to add such a file in

~/.ros/rootfs/fs/microsd/etc/loggin/...

and in

PX4  /build_posix_sitl_default/tmp/rootfs/fs/etc/logging

but none works. Does anyone know where to add the logger_topics.txt so that it can be found?

Best regards
Nils

I believe it should be in Firmware/build_posix_sitl_default/tmp/rootfs/fs/microsd/etc/logging/logger_topics.txt.

Hi,

I figured out where the problem is. The correct implementation for in the logger_topics.txt is, for example,

att_pos_mocap

instead of

<att_pos_mocap>

I have another problem. When I try to use pyulog to transform my ulg data to csv I got the follwoing error:

Traceback (most recent call last):
File "/home/hippoc/.local/bin/ulog2csv", line 11, in <module>
sys.exit(main())
File "/home/hippoc/.local/lib/python2.7/site-packages/pyulog/ulog2csv.py", line 43, in main
convert_ulog2csv(args.filename, args.messages, args.output, args.delimiter)
File "/home/hippoc/.local/lib/python2.7/site-packages/pyulog/ulog2csv.py", line 60, in convert_ulog2csv
ulog = ULog(ulog_file_name, msg_filter)
File "/home/hippoc/.local/lib/python2.7/site-packages/pyulog/core.py", line 97, in __init__
self._load_file(file_name, message_name_filter_list)
File "/home/hippoc/.local/lib/python2.7/site-packages/pyulog/core.py", line 377, in _load_file
self._read_file_definitions()
File "/home/hippoc/.local/lib/python2.7/site-packages/pyulog/core.py", line 402, in _read_file_definitions
header.initialize(data)
File "/home/hippoc/.local/lib/python2.7/site-packages/pyulog/core.py", line 213, in initialize
self.msg_size, self.msg_type = ULog._unpack_ushort_byte(data)
struct.error: unpack requires a string argument of length 3

My message definition looks like

# Logging data for HippoCampus

float32 x		# in meters NED
float32 y		# in meters NED
float32 z		# in meters NED
float32 xd		# in meters/sec
float32 yd		# in meters/sec
float32 zd		# in meters/sec

Does anyone know why I get the error?

I already found my mistake. I have done something wrong in the code thus the message which I tried to logg hasn’t been published. Now it works.