ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS noetic: I want to use GNSS data in Rvis, but an error occurs in the catkin build.

asked 2022-08-15 19:28:13 -0500

donguri gravatar image

updated 2023-06-18 10:05:32 -0500

lucasw gravatar image

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/91d7ea5...

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/8fd8ef6...

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 ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2022-08-16 04:53:46 -0500

ravijoshi gravatar image

updated 2022-08-16 04:54:42 -0500

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
edit flag offensive delete link more

Comments

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.

donguri gravatar image donguri  ( 2022-08-17 07:56:22 -0500 )edit

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.

donguri gravatar image donguri  ( 2022-08-17 08:04:24 -0500 )edit

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?

donguri gravatar image donguri  ( 2022-08-17 08:23:29 -0500 )edit
  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.
ravijoshi gravatar image ravijoshi  ( 2022-08-17 21:22:13 -0500 )edit

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.

donguri gravatar image donguri  ( 2022-08-18 08:22:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-08-15 19:28:13 -0500

Seen: 627 times

Last updated: Aug 17 '22