Ask Your Question
0

how do i change topic name for ar_pose?

asked 2011-05-23 08:57:38 -0600

jrieffel gravatar image

updated 2011-05-23 08:58:04 -0600

By default, ar_pose package looks for Image data published by usb_cam, but I would like it to look for Image data published by a different node (ar_drone). Is there a way to change the topic source without hacking the source code for ar_pose?

I notice that ar_kinect must do something similar.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
5

answered 2011-05-23 09:00:17 -0600

Eric Perko gravatar image

You are looking for remapping of topic names. See this question: http://answers.ros.org/question/817/what-is-the-convention-for-topic-name for details.

edit flag offensive delete link more
0

answered 2016-04-14 09:56:54 -0600

Hi, this is my launch file (working). Remember to calibrate the drone's camera:

<launch>
    <!-- IPv4 address of your drone -->
    <arg name="ip" default="192.168.1.1"/>

    <!-- Ultrasound frequency (7 or 8). -->
    <arg name="freq" default="8"/>
    <node name="ardrone_driver" pkg="ardrone_autonomy" type="ardrone_driver" output="screen" clear_params="true" args="-ip $(arg ip)">
        <param name="outdoor" value="0"/>
        <param name="max_bitrate" value="1000"/>
        <param name="bitrate" value="1000"/>
        <param name="navdata_demo" value="0"/>
        <param name="flight_without_shell" value="0"/>
        <param name="altitude_max" value="4000"/>
        <param name="altitude_min" value="50"/>
        <param name="euler_angle_max" value="0.21"/>
        <param name="control_vz_max" value="700"/>
        <param name="control_yaw" value="1.75"/>
        <param name="detect_type" value="10"/>
        <param name="enemy_colors" value="3"/>
        <param name="detections_select_h" value="32"/>
        <param name="detections_select_v_hsync" value="128"/>
        <param name="enemy_without_shell" value="0"/>
        <param name="ultrasound_freq" value="$(arg freq)"/>
        <param name="realtime_navdata" value="true"/>
        <param name="realtime_video" value="true"/>
        <!-- Covariance Values (3x3 matrices reshaped to 1x9)-->
        <rosparam param="cov/imu_la">[0.1, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.1]</rosparam>
        <rosparam param="cov/imu_av">[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]</rosparam>
        <rosparam param="cov/imu_or">[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 100000.0]</rosparam>

        <!-- Remapping for perceiving markers -->
        <remap from="ardrone/image_raw" to="/camera/image_raw" />
        <remap from="ardrone/camera_info" to="/camera/camera_info" />

    </node>

    <!-- Launch the static transform publisher for world to camera -->
    <!--<node pkg="tf" type="static_transform_publisher" name="cam_to_drone" args="1 0 0 0 0 0 world ardrone_base_frontcam 10"/>-->
    <!--<node pkg="tf" type="static_transform_publisher" name="world_to_cam" args="1 0 0.5 -1.57 0 -1.57 camera ardrone_base_frontcam 10"/>-->



    <!-- Launch the image rectification node -->
    <!--<node ns="camera" pkg="image_proc" type="image_proc" name="image_proc"/>-->

    <!-- Start the GSCAM node -->
    <!-- devide=/dev/video0 for webcam, /dev/video1 for usbcamera -->
    <!--<env name="GSCAM_CONFIG" value="v4l2src device=/dev/video0 ! video/x-raw-yuv,framerate=30/1,width=640,height=480 ! ffmpegcolorspace "/>
    <node pkg="gscam" type="gscam" name="gscam" output="screen">
        <param name="width" type="int" value="640"/>
        <param name="height" type="int" value="480"/>
        <param name="fps" type="int" value="30"/>
        <param name="frame_id" type="string" value="ardrone_base_frontcam"/>
        <param name="camera_info_url" type="string" value="file://$(find gscam)/camera_calibration.yaml"/>
    </node>-->

    <node name="ar_pose" pkg="ar_pose" type="ar_single" respawn="false" output="screen">
        <param name="marker_pattern" type="string" value="$(find ar_pose)/data/4x4/4x4_1.patt"/>
        <param name="marker_width" type="double" value="152.4"/>
        <param name="marker_center_x" type="double" value="0.0"/>
        <param name="marker_center_y" type="double" value="0.0"/>
        <param name="threshold" type="int" value="100"/>
        <param name="use_history" type="bool" value="true"/>
        <!--<param name="camera_image_topic" type="string" value="/ardrone/front/image_raw"/>
        <param name="camera_info_topic" type="string" value="/ardrone/front/camera_info"/>-->
    </node>

    <!-- Launch RVIZ as visualizer -->
    <!--<node pkg="rviz" type="rviz" name="rviz" args="-d $(find ar_pose)/launch/live_single.rviz"/>-->

</launch>
edit flag offensive delete link more
-1

answered 2011-06-28 07:39:10 -0600

Nikhil Soni gravatar image

I am new at ROS and I am trying to do the same thing, getting ar_pose to work with the video input from ar_drone. When I am trying to remap while launching ardrone_driver like this:

rosrun ardrone_brown ardrone_driver /ardrone/image_raw:=/usb_cam/image_raw

It does not remap. Please help.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-05-23 08:57:38 -0600

Seen: 1,891 times

Last updated: Apr 14 '16