Rather than editing someone else's package that's under source control, why not just edit your own package? When the whycon
package gets updated (and it probably will because it looks active) anything that you changed in there will be gone when you update (pull) it. If you change files in your own package then you don't have to worry about that because you're in control.
Now, on to the solution. The topic names get defined in your task_1_1.world
file. You have two options:
- add a
remap
tag to your task_1.launch
(easiest/best)
- change your world file (still easy).
Option 1: add a remap
tag
Because the topic names are defined in your world file you should add the remap
tag before the include
of the gazebo
node:
<launch>
<remap from="/main/image_raw" to="/camera/image_raw"/> <!-- Add this line -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find task_1)/world/task_1_1.world"/>
<arg name="headless" value="true"/>
<arg name="gui" value="true"/>
<arg name="verbose" value="true"/>
</include>
</launch>
More information about launch files and remapping can be found in the wiki.
Option 2: modify world file
The topic names get defined in your task_1_1.world
file on line 113:
<plugin name='camera_control' filename='libgazebo_ros_camera.so'>
<cameraName>/main_camera</cameraName>
<alwaysOn>true</alwaysOn>
<updateRate>60</updateRate>
<imageTopicName>/main/image_raw</imageTopicName>
<cameraInfoTopicName>/main/camera_info</cameraInfoTopicName>
<frameName>main_camera</frameName>
</plugin>
change
<imageTopicName>/main/image_raw</imageTopicName>
<cameraInfoTopicName>/main/camera_info</cameraInfoTopicName>
to
<imageTopicName>/camera/image_raw</imageTopicName>
<cameraInfoTopicName>/camera/camera_info</cameraInfoTopicName>
Now run rostopic list
and you'll see that you have
/camera/camera_info
/camera/image_raw
/camera/image_raw/compressed
/camera/image_raw/compressed/parameter_descriptions
/camera/image_raw/compressed/parameter_updates
/camera/image_raw/compressedDepth
/camera/image_raw/compressedDepth/parameter_descriptions
/camera/image_raw/compressedDepth/parameter_updates
/camera/image_raw/theora
/camera/image_raw/theora/parameter_descriptions
/camera/image_raw/theora/parameter_updates
and you can save two versions of your world file and you can pick and choose which one you want to use. However, option 1 is (in my opinion) better.
Originally posted by jayess with karma: 6155 on 2017-11-13
This answer was ACCEPTED on the original site
Post score: 4