SyntaxError: invalid syntax
It happens when i run Register step for rosbag1.
Failed to load Python extension for LZ4 support. LZ4 compression will not be available. Traceback (most recent call last): File "/home/dongsongb/PYTHON-PROJ/scene_choose/ros2bag2csv_try.py", line 24, in register_rosbag1 register_types(typs) File "/home/dongsongb/anaconda3/envs/rosbag2csv/lib/python3.10/site-packages/rosbags/typesys/register.py", line 159, in register_types exec(code, module.dict) # pylint: disable=exec-used File "", line 1833 yield: ClassVar[int] = 4 ^ SyntaxError: invalid syntax python-BaseException
It look likes this if i copy it into txt.
@dataclass class adc_traj_msg__msg__ObjectTag: """Class for adc_traj_msg/msg/ObjectTag."""
value: int
not_set: ClassVar[int] = 0
ignore: ClassVar[int] = 1
stop: ClassVar[int] = 2
follow: ClassVar[int] = 3
yield: ClassVar[int] = 4
overtake: ClassVar[int] = 5
nudge: ClassVar[int] = 6
avoid: ClassVar[int] = 7
side_pass: ClassVar[int] = 8
__msgtype__: ClassVar[str] = 'adc_traj_msg/msg/ObjectTag'
It actully because "key word"->yield are used when code were generated ,but it's not easy for me tackle this problem, so can you give me some advice,or maybe add some protect method in source code. By the way,should i run the register step every times before i read bags?
And one more question: Is it more logical if the topics, which are need to-be read ,should be register ,and it makes the process more convenient, after all people are only focus the topics they can ues.