jrl-umi3218 / mc_rtc

mc_rtc is an interface for simulated and real robotic systems suitable for real-time control
BSD 2-Clause "Simplified" License
122 stars 36 forks source link

[mc_log_ui] Failure to save X/Y plot #320

Closed mmurooka closed 1 year ago

mmurooka commented 1 year ago

In mc_log_ui, I get the following error when trying User plots->Save current plot for X/Y plot.

$ lsb_release -d
Description:    Ubuntu 20.04.5 LTS
$ python3 --version
Python 3.8.10
$ mc_log_ui /tmp/mc-control-BaselineWalkingController-latest.bin 
Traceback (most recent call last):
  File "/home/mmurooka/workspace/install/lib/python3.8/site-packages/mc_log_ui/mc_log_ui.py", line 995, in save_userplot
    self.saveUserPlots()
  File "/home/mmurooka/workspace/install/lib/python3.8/site-packages/mc_log_ui/mc_log_ui.py", line 895, in saveUserPlots
    json.dump(self.userPlotList, f, default = default_, indent = 2, separators = (',', ': '))
  File "/usr/lib/python3.8/json/__init__.py", line 179, in dump
    for chunk in iterable:
  File "/usr/lib/python3.8/json/encoder.py", line 429, in _iterencode
    yield from _iterencode_list(o, _current_indent_level)
  File "/usr/lib/python3.8/json/encoder.py", line 325, in _iterencode_list
    yield from chunks
  File "/usr/lib/python3.8/json/encoder.py", line 325, in _iterencode_list
    yield from chunks
  File "/usr/lib/python3.8/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/home/mmurooka/workspace/install/lib/python3.8/site-packages/mc_log_ui/mc_log_ui.py", line 893, in default_
    return o.__dict__
AttributeError: 'dict_values' object has no attribute '__dict__'

mc_log_ui is installed from source (revision https://github.com/jrl-umi3218/mc_rtc/commit/c3464c331c09e3629983d361648b546394c0e8e8).

gergondet commented 1 year ago

Hi @mmurooka

Thanks for reporting the issue. The commit above should fix the issue while its parent (7ee416ddfcab22b004f95ce7a7351eb54a7537a2) fix issues related to diff plots in user plots (and add support for saving/loading RPY diff plots introduced in #317)