0
$\begingroup$

Rosanswers logo

Hi, I am running Ubuntu 14.04. I've successfully installed ROS Indigo. I have also set up the catkin workspace from ROS tutorials successfully. I have installed two packages from package 1 and whycon from https://github.com/lrse/whycon.git and https://github.com/simmubhangu/task_1.git(package 1). Then i run commands roslaunch task_1 task_1_1.launch. It launches the gazebo world. Then I had to remap a topic /main/image_raw to whycon. There is a whycon.launch file I have to remap the /whycon/image_out topic /main/image_raw but when i add the following code

<node name="image_view" pkg="gazebo" type="/main/image_raw" respawn="false" output="screen">
<remap from="image" to="/whycon/image_out"/>
<param name="autosize" value="true" />
</node> 

Topic /main/image_raw is published by node /gazebo.When I run roslaunch whycon whycon.launch the error says cant find node gazebo. But in rosnode list there is a node /gazebo. I am new to ros , so any help is appreciated.


Originally posted by alienmonster on ROS Answers with karma: 3 on 2017-11-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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:

  1. add a remap tag to your task_1.launch (easiest/best)
  2. 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

$\endgroup$

Your Answer

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