0
$\begingroup$

Rosanswers logo

First

I started studying ROS about a week ago. I started learning ROS about a week ago. I apologize if this question is elementary. I have git cloned a package that I want to use in ROS, but when I do a catkin build, I get a build error. If anyone has a solution, please let me know.

##Environment##

  • Ubuntu 20.04
  • ROS noetic
  • GNSS receiver module : ZED-F9P

##Final Goal## I want to reflect GNSS data in ROS Rvis and use it for autonomous movement of the robot.

##Current problem## We performed the procedure with reference to the following site.

Reference site: https://qiita.com/k-koh/items/91d7ea55cbdfc3d3aaf9

Procedure

I got the following error when I did a catkin build.

error message:

/home/ubuntu/catkin_ws/src/gps_rviz_plugin/src/overlay_gps_display.cpp:55:33: error: ‘PyString_FromString’ was not declared in this scope; did you mean ‘PyLong_FromString’?

55 | PyObject* request_url_str = PyString_FromString(request_url.c_str());

PyString_FromString --> PyLong_FromString

I tried changing line 55 in overlay_gps_display according to the error message, but when I run build again, I got the following error when I did a catkin build.

Errors << gps_rviz_plugin:make /home/ubuntu/catkin_ws/logs/gps_rviz_plugin/build.make.003.log /home/ubuntu/catkin_ws/src/gps_rviz_plugin/src/overlay_gps_display.cpp: In member function ‘bool gps_rviz_plugin::OverlayGpsDisplay::download_map(std::string)’:

/home/ubuntu/catkin_ws/src/gps_rviz_plugin/src/overlay_gps_display.cpp:55:70: error: too few arguments to function ‘PyObject* PyLong_FromString(const char*, char**, int)’

55 | PyObject* request_url_str = PyLong_FromString(request_url.c_str());

  |                                                          ^

In file included from /usr/include/python3.8/Python.h:98,

             from /home/ubuntu/catkin_ws/src/gps_rviz_plugin/include/overlay_gps_display.h:42,
             from /home/ubuntu/catkin_ws/src/gps_rviz_plugin/src/overlay_gps_display.cpp:1:

/usr/include/python3.8/longobject.h:103:24: note: declared here

103 | PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);

  |                        ^~~~~~~~~~~~~~~~~

make[2]: *** [CMakeFiles/gps_rviz_plugin.dir/build.make:76:

CMakeFiles/gps_rviz_plugin.dir/src/overlay_gps_display.cpp.o] error 1

make[1]: *** [CMakeFiles/Makefile2:211: CMakeFiles/gps_rviz_plugin.dir/all] error 2

make: *** [Makefile:141: all] error 2

※The following has been resolved

Also, I have performed the procedure with reference to the following site.

Reference site: https://qiita.com/k-koh/items/8fd8ef6310e4f40fa536

Procedure

I got the following error when I did a catkin build.

Cmake Error at /opt//ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package)

Could not find a package configuration file provided by "rtcm_msgs" with any of the following names:

rtcm_msgsConfig.cmake

rtcm?_msgs-config.cmake

Add the installation prefix of "rtcm_msgs" to CMAKE_PREFIX_PATH or set "rtcm_msgs_DIR" to a directory containing one of the above files. If "rtcm_msgs" provides a separate development package or SDK, be sure it has been installed.

Call Stack (most recent call first):

CmakeLists.txt:3 (find_package)

My guess is that it is due to my ROS version being different from the reference site. Is there any way to make GNSS data available in Rviz?

##At the end## I am new to ROS, so I am not very good at asking questions, but I intend to learn more. I hope you can help me.


Originally posted by donguri on ROS Answers with karma: 13 on 2022-08-15

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There are multiple questions asked in this question. In general, asking only one question in a post is advised to keep it cleaner and simpler. Nevermind.

1. 'PyString_FeomString' was not declared

error: 'PyString_FeomString' was not declared in this scops: did you mean 'PyLong_FeomString'

It seems that the code is edited. Note that the incorrect "PyString_FeomString" (r is replaced by e) by mistake.

2. "rtcm_msgs" not found

Could not find a package configuration file provided by "rtcm_msgs" with any of the following names:

The package ublox/ublox_gps uses rtcm_msgs, which has been mentioned in the CMakeLists.txt file. Furthermore, you are receiving an error because you do not have rtcm_msgs installed in your machine. Please install it using apt as shown below:

sudo apt install ros-noetic-rtcm-msgs

Originally posted by ravijoshi with karma: 1744 on 2022-08-16

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by donguri on 2022-08-17:
Hi Mr.Ravi Joshi. Thanks for replying. Also sorry for the delay in replying to you.

First of all, regarding the error 'PyString_FeomString' in the question you posted, this is my typing error. The correct name is 'PyString_FromString'. This mistake is due to the fact that I 'typed' the error statement that occurred, instead of 'copy and pasting' it. My sincere apologies. I will correct it in the question text.

I would like to correct the error statement that occurred when I executed 'catkin build' after replacing 'PyString_FromString' with 'PyLong_FromString' in the question text.

Comment by donguri on 2022-08-17:
Next, thanks to your advice about "rtcm_msgs", I was able to solve it.

sudo apt install ros-noetic-rtcm-msgs
sudo apt install ros-noetic-nmea-msgs

By running the above two, I was able to run the 'catkin build'. Thank you very much.

Comment by donguri on 2022-08-17:
In summary, what I currently do not know is about build-error after replacing "PyString_FromString" with "PyLong_FromString". I do not know what is causing the error or how to deal with it to make it usable.

error: too few arguments to function ‘PyObject* PyLong_FromString(const char, char*, int)’

What factor should I increase?

Comment by ravijoshi on 2022-08-17:\

  1. You needed to install ros-noetic-nmea-msgs because it is mentioned as a dependency in the CMakeLists.txt file. I am glad to could do it successfully.
  2. I guess that you need to replace PyString_FromString with PyUnicode_FromString. Please see a proper explanation in the answer above.

Comment by donguri on 2022-08-18:
Thanks for your reply.

Thanks to you I was able to do the 'catkin build'.

Also, I was wrong about the 'Unicode' thing. I would like to deepen my understanding of 'PyUnicode' again.

Finally, thank you very much for your detailed answer to my beginner's question. I will try my best to acquire more knowledge about ROS and grow up to be like you.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.