Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the encoding problem for subprocess.check_output #14125

Merged
merged 1 commit into from
Feb 9, 2020
Merged

fix the encoding problem for subprocess.check_output #14125

merged 1 commit into from
Feb 9, 2020

Conversation

stmoon
Copy link
Contributor

@stmoon stmoon commented Feb 9, 2020

Describe problem solved by this pull request
When I compile make px4_sitl_rtps, I found the error like below with just standalone, no ROS.

stmoon@stmoon-XPS-13-9370:/home/px4/firmware.rtps/Firmware.stmoon/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_client/micrortps_agent/build$ make 
Scanning dependencies of target micrortps_agent
[  0%] Building CXX object CMakeFiles/micrortps_agent.dir/RtpsTopics.cpp.o
In file included from /home/px4/firmware.rtps/Firmware.stmoon/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_client/micrortps_agent/RtpsTopics.h:38:0,
                 from /home/px4/firmware.rtps/Firmware.stmoon/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_client/micrortps_agent/RtpsTopics.cpp:34:
/home/px4/firmware.rtps/Firmware.stmoon/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_client/micrortps_agent/adc_report_Publisher.h:60:18: error: ‘px4’ has not been declared
     void publish(px4::msg::adc_report* st);
                  ^~~
/home/px4/firmware.rtps/Firmware.stmoon/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_client/micrortps_agent/adc_report_Publisher.h:60:38: error: expected ‘,’ or ‘...’ before ‘*’ token

Describe your solution

I found the python code output type of subprocess.check_output is binary in my case. To clarify it, I clarify the encoding type, utf-8 like below

rosversion_out = rosversion_out.rstrip().decode('utf-8')

Actually, I solved the problem in another pull request. However, I think the problem should be separated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants