Gazebo | Ignition | Community
Ask Your Question
0

What type of message will I receive for a event from libSimEventsPlugin.so?

asked 2020-09-14 06:10:29 -0600

dragobette gravatar image

updated 2020-09-14 06:17:59 -0600

    <plugin
    <filename="libSimEventsPlugin.so"
    <name="event_plugin">
    <region>
    <name>Region1</name>
    <volume>
    <min> 0 0 0 </min>
    <max> 1 1 1 </max> 
    </volume>
    </region>
    <event>
    <name>region1_event</name>
    <type>occupied</type>
    <region>Region1</region>
    <topic>~/elevator</topic>
    <msg_data>received message CONGRATS </msg_data>
    </event> 
    </plugin>

My callback function is like this:

void cb(ConstSimEventPtr &msg);

I've also tried as in the following link:

void cb(ConstWorldStatisticsPtr &_msg)

The problem is that when I spawn my model in the specified region, the application crashes with the following message:

gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = const gazebo::msgs::WorldStatistics; typename boost::detail::sp_member_access<T>::type = const gazebo::msgs::WorldStatistics*]: Assertion `px != 0' failed.
Aborted (core dumped)

My question is: what data type is the msg that I have to receive from the plugin?

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-09-14 07:38:03 -0600

dragobette gravatar image

updated 2020-09-14 07:50:46 -0600

it is a ConstGzStringPtr , and the error means that a null pointer was stored in a shared pointer that was dereferenced specifically a boost::shared_ptr<gazebo::msgs::WorldStatistics>.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2020-09-14 06:10:29 -0600

Seen: 41 times

Last updated: Sep 14 '20