0
$\begingroup$

Rosanswers logo

Hi Guys,

I wanted to modify stageros.cpp in a very minor way. I wanted the /odom topic to be published with a different name, so I went ahead and changed the string at the top of the file to "canbus". After rosmaking stage, it seg faults at startup. Even when I change the string "canbus" back to "odom" and rosmake it once again, it still seg faults.

I checked the seg fault issue of stage listed on the stage page on the ros site, but thats not the problem in my case.

Where am I going wrong ?

The backtrace is as follows,

Core was generated by `./stageros ../world/try.world'.
Program terminated with signal 11, Segmentation fault.
#0  boost::shared_ptr<ros::Publisher::Impl>::operator! (this=0x0, message=...) at /usr/include/boost/smart_ptr/detail/operator_bool.hpp:55
55          return px == 0;
(gdb) bt
#0  boost::shared_ptr<ros::Publisher::Impl>::operator! (this=0x0, message=...) at /usr/include/boost/smart_ptr/detail/operator_bool.hpp:55
#1  ros::Publisher::publish<nav_msgs::Odometry_<std::allocator<void> > > (this=0x0, message=...) at /opt/ros/cturtle/ros/core/roscpp/include/ros/publisher.h:95
#2  0x000000000040e7f1 in StageNode::WorldCallback (this=0x7fff89629870) at /opt/ros/cturtle/stacks/simulator_stage/stage/src/stageros.cpp:355
#3  0x000000000041c2ac in StageNode::s_update (world=<value optimized out>, node=0x1fae778) at /opt/ros/cturtle/stacks/simulator_stage/stage/src/stageros.cpp:88
#4  0x00007f38f712322e in Stg::World::CallUpdateCallbacks (this=0x13ca4d0) at /opt/ros/cturtle/stacks/simulator_stage/stage/build/Stage-3.2.2-Source/libstage/world.cc:481
#5  0x00007f38f7123604 in Stg::World::Update (this=0x13ca4d0) at /opt/ros/cturtle/stacks/simulator_stage/stage/build/Stage-3.2.2-Source/libstage/world.cc:552
#6  0x00007f38f713c501 in Stg::WorldGui::Update (this=0x13ca4d0) at /opt/ros/cturtle/stacks/simulator_stage/stage/build/Stage-3.2.2-Source/libstage/worldgui.cc:364
#7  0x00007f38f6a2f008 in Fl::wait(double) () from /usr/lib/libfltk.so.1.1
#8  0x0000000000414984 in main (argc=2, argv=<value optimized out>) at /opt/ros/cturtle/stacks/simulator_stage/stage/src/stageros.cpp:440

Thanks, Sagnik


Originally posted by Sagnik on ROS Answers with karma: 184 on 2011-03-10

Post score: 0


Original comments

Comment by Sagnik on 2011-03-10:
Ah, my bad.... I had modified another line unknowingly, and that was causing the seg fault. My apologies for asking the question without double-checking.

Comment by Eric Perko on 2011-03-10:
Can you post your modified version of the code (perhaps on pastebin or a gist on github or something)? And are you certain you didn't change anything but the topic name?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Closing as resolved by bad change in code. See comment above from @sagnik

For future reference if you want to change the topic on which something is published you should use topic remapping.


Originally posted by tfoote with karma: 58457 on 2011-03-10

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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