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

Padmal's profile - activity

2020-09-14 11:04:36 -0500 received badge  Famous Question (source)
2020-08-05 08:08:33 -0500 received badge  Notable Question (source)
2020-08-04 03:17:45 -0500 marked best answer Convert Float32 to C++ float variable

Hi, I'm trying to convert a Float32 type std_msg into a float variable. Following is the code I have at the moment.

void update_yaw(const std_msgs::Float32 &yaw)
{
    std_msgs::Float32 imu;
    imu = *yaw;
    fromIMU::Yaw = float(imu.data);
    ROS_INFO("Yaw updated");
}

But when I try to compile, the following error comes.

/home/padmal/catkin_ws/src/ouster_example/ouster_ros/src/merger_node.cpp: In function ‘void update_yaw(const Float32&)’:
/home/padmal/catkin_ws/src/ouster_example/ouster_ros/src/merger_node.cpp:89:11: error: no match for ‘operator*’ (operand type is ‘const Float32 {aka const std_msgs::Float32_<std::allocator<void> >}’)
     imu = *yaw;
           ^~~~
In file included from /usr/include/boost/config/no_tr1/complex.hpp:21:0,
                 from /usr/include/boost/math/policies/error_handling.hpp:17,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/melodic/include/ros/time.h:58,
                 from /opt/ros/melodic/include/ros/ros.h:38,
                 from /home/padmal/catkin_ws/src/ouster_example/ouster_ros/src/merger_node.cpp:1:
/usr/include/c++/7/complex:404:5: note: candidate: template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const std::complex<_Tp>&)
     operator*(const _Tp& __x, const complex<_Tp>& __y)
     ^~~~~~~~
/usr/include/c++/7/complex:404:5: note:   template argument deduction/substitution failed:
/home/padmal/catkin_ws/src/ouster_example/ouster_ros/src/merger_node.cpp:89:12: note:   candidate expects 2 arguments, 1 provided
     imu = *yaw;
            ^~~
In file included from /usr/include/boost/config/no_tr1/complex.hpp:21:0,
                 from /usr/include/boost/math/policies/error_handling.hpp:17,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/melodic/include/ros/time.h:58,
                 from /opt/ros/melodic/include/ros/ros.h:38,
                 from /home/padmal/catkin_ws/src/ouster_example/ouster_ros/src/merger_node.cpp:1:
/usr/include/c++/7/complex:395:5: note: candidate: template<class _Tp> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const _Tp&)
     operator*(const complex<_Tp>& __x, const _Tp& __y)
     ^~~~~~~~
/usr/include/c++/7/complex:395:5: note:   template argument deduction/substitution failed:
/home/padmal/catkin_ws/src/ouster_example/ouster_ros/src/merger_node.cpp:89:12: note:   ‘const Float32 {aka const std_msgs::Float32_<std::allocator<void> >}’ is not derived from ‘const std::complex<_Tp>’
     imu = *yaw;
            ^~~
In file included from /usr/include/boost/config/no_tr1/complex.hpp:21:0,
                 from /usr/include/boost/math/policies/error_handling.hpp:17,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/melodic/include/ros/time.h:58,
                 from /opt/ros/melodic/include/ros/ros.h:38,
                 from /home/padmal/catkin_ws/src/ouster_example/ouster_ros/src/merger_node.cpp:1:
/usr/include/c++/7/complex:386:5: note: candidate: template<class _Tp> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const std::complex<_Tp>&)
     operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
     ^~~~~~~~
/usr/include/c++/7/complex:386:5: note:   template argument deduction/substitution failed:
/home/padmal/catkin_ws/src/ouster_example/ouster_ros/src/merger_node.cpp:89:12: note:   ‘const Float32 {aka const std_msgs::Float32_<std::allocator<void> >}’ is not derived from ‘const std::complex<_Tp>’
     imu = *yaw;
            ^~~

What could be the issue here? Thanks in advance.

2020-08-04 03:17:45 -0500 received badge  Scholar (source)
2020-08-04 03:17:45 -0500 received badge  Supporter (source)
2020-08-04 03:00:01 -0500 received badge  Popular Question (source)
2020-08-04 01:02:22 -0500 edited question Convert Float32 to C++ float variable

Convert Float64 to C++ float variable Hi, I'm trying to convert a Float32 type std_msg into a float variable. Following

2020-08-04 00:54:05 -0500 asked a question Convert Float32 to C++ float variable

Convert Float64 to C++ float variable Hi, I'm trying to convert a Float32 type std_msg into a float variable. Following

2019-03-01 16:28:40 -0500 marked best answer Gazebo command doesn't open Gazebo

Hi!

I've been trying to run hector_quadrotor packages for a research. For this, I have to launch gazebo simulator. I have installed ROS Kinetic on a 64bit Ubuntu 16.04 LTS machine.

When I try to run;

$ roslaunch hector_quadrotor_demo indoor_slam_gazebo.launch

I get RViz open correctly. (I couldn't upload a screenshot). It only shows the image part to the left in this similar image. I don't get gazebo open to show me the 3D view of the environment.

So I checked the console log and it shows the following error message.

[gazebo_gui-3] process has died [pid 21110, exit code 132, cmd /opt/ros/kinetic/lib/gazebo_ros/gzclient __name:=gazebo_gui __log:=/home/knight/.ros/log/764ebc9e-aa64-11e8-b5f5-6045cb73915a/gazebo_gui-3.log].
log file: /home/knight/.ros/log/764ebc9e-aa64-11e8-b5f5-6045cb73915a/gazebo_gui-3*.log

I tried to find such a log file and surprisingly there is none in that folder. I Googled this error message and tried many methods as reinstalling gazebo version 9 and then again version 7 but still it's not opening gazebo.

I tried gazebo command on the console itself and it just stays for a few seconds and then I get console prompt again. So I tried verbose;

gazebo --verbose
Gazebo multi-robot simulator, version 7.14.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
Gazebo multi-robot simulator, version 7.14.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.1.102
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.1.102

After this set of messages I get the console prompt (knight@AID:~$) again.

When I quit RViz window, it closes with the following message.

 [gazebo-2] killing on exit

I wonder what could be the possible reason/s for this failure. Help is much appreciated. Thanks a lot!

2019-03-01 16:27:46 -0500 received badge  Famous Question (source)
2018-12-21 05:37:27 -0500 received badge  Notable Question (source)
2018-11-11 10:27:27 -0500 received badge  Popular Question (source)
2018-08-27 23:15:23 -0500 asked a question Gazebo command doesn't open Gazebo

Gazebo command doesn't open Gazebo Hi! I've been trying to run hector_quadrotor packages for a research. For this, I ha