jhu-dvrk / dvrk-ros

daVinci Research Kit ROS stack. See dVRK wiki to get started: https://github.com/jhu-dvrk/sawIntuitiveResearchKit/wiki
https://github.com/jhu-dvrk/sawIntuitiveResearchKit/wiki
Other
100 stars 80 forks source link

dvrk_calibrate_potentiometers.py TypeError: a bytes-like object is required, not 'str' #36

Closed linhongbin closed 3 years ago

linhongbin commented 3 years ago

There are minor errors when running dvrk_calibrate_potentiometers.py

Environment: python3, Ubuntu20.04, noetic.

File "/home/ben/software/dvrk_ws/src/dvrk-ros/dvrk_robot/scripts/dvrk_calibrate_potentiometers.py", line 339, in <module>
    calibration.run(args.type, args.config)
  File "/home/ben/software/dvrk_ws/src/dvrk-ros/dvrk_robot/scripts/dvrk_calibrate_potentiometers.py", line 250, in run
    writer.writerow(header)
TypeError: a bytes-like object is required, not 'str'

User can easily fixed the issue by replacing

## replacing these lines
# f = open(csv_file_name, 'wb')
f = open(csv_file_name, 'w')

It might be helpful to python3 users. Not sure if it is compatible with python2.

adeguet1 commented 3 years ago

Hello. I fixed this in the devel branch a few days ago: https://github.com/jhu-dvrk/dvrk-ros/commit/6429e15b558597a5206e97ef7a7fc9b2afe90119 I plan to release this along 2.0.2. I need to finish some urgent work to support new instruments and would like to add this to the 2.0.2 release so that might take a few weeks. Meanwhile, you can also use the devel branches using wstool merge https://raw.githubusercontent.com/jhu-dvrk/dvrk-ros/devel/dvrk_ros.rosinstall.

linhongbin commented 3 years ago

great. thanks