ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How do you publish Hokuyo laser data to a specific frame?

asked 2018-07-13 05:24:32 -0600

dkrivet gravatar image

updated 2018-07-17 11:34:50 -0600

jayess gravatar image

I am trying to do autonomous navigation on a jackal robot equipped with a pointgrey bumblebee2 camera and a Hokuyo laser. I have got the hokuyo laser to publish data to my desired topic (/front/scan) but when I run Rviz I get the error:

Transform [sender=unknown_publisher] For frame [laser]:Frame [laser] does not exist

I have done some debugging and got the message:

MessageFilter [target=odom front_laser]: Added message in frame laser at time ..., count now 50

I think when I run the Hokuyo node by:

rosin hokuyo_node hokuyo_node scan:=/front/scan

that it add the messages to the default laser frame, so I am wondering how to change this so it adds the messages to the front_laser frame.

<?xml version="1.0"?>
<robot name="jackal" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <xacro:property name="PI" value="3.1415926535897931" />

  <xacro:property name="wheelbase" value="0.262" />
  <xacro:property name="track" value="0.37559" />
  <xacro:property name="wheel_vertical_offset" value="0.0345" />
  <xacro:property name="footprint_vertical_offset" value="-0.0655" />

  <xacro:property name="wheel_radius" value="0.098" />
  <xacro:property name="wheel_width" value="0.040" />

  <xacro:property name="chassis_length" value="0.420" />
  <xacro:property name="chassis_width" value="0.310" />
  <xacro:property name="chassis_height" value="0.184" />

  <xacro:property name="dummy_inertia" value="1e-09"/>

  <xacro:property name="mount_spacing" value="0.120" />

  <material name="dark_grey"><color rgba="0.2 0.2 0.2 1.0" /></material>
  <material name="light_grey"><color rgba="0.4 0.4 0.4 1.0" /></material>
  <material name="yellow"><color rgba="0.8 0.8 0.0 1.0" /></material>
  <material name="black"><color rgba="0.15 0.15 0.15 1.0" /></material>

  <xacro:macro name="wheel" params="prefix *joint_pose">

    <link name="${prefix}_wheel_link">
      <visual>
        <origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
        <geometry>
          <mesh filename="package://jackal_description/meshes/jackal-wheel.stl"/>
        </geometry>
        <material name="black" />
      </visual>
      <collision>
        <origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
        <geometry>
          <cylinder radius="${wheel_radius}" length="${wheel_width}"/>
        </geometry>
      </collision>
      <inertial>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <mass value="0.477"/>
        <inertia
          ixx="0.0013" ixy="0" ixz="0"
          iyy="0.0024" iyz="0"
          izz="0.0013"/>
      </inertial>
    </link>

    <gazebo reference="${prefix}_wheel_link">
      <material>Gazebo/DarkGrey</material>
    </gazebo>

    <joint name="${prefix}_wheel" type="continuous">
      <parent link="chassis_link"/>
      <child link="${prefix}_wheel_link" />
      <xacro:insert_block name="joint_pose" />
      <axis xyz="0 1 0" />
    </joint>

    <!-- In reality, Jackal has only two motors, one per side. However, it's more
         straightforward for Gazebo to simulate as if there's an actuator per wheel. -->
    <transmission name="${prefix}_wheel_trans">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="${prefix}_wheel">
        <hardwareInterface>VelocityJointInterface</hardwareInterface>
      </joint>
      <actuator name="${prefix}_actuator">
        <mechanicalReduction>1</mechanicalReduction>
      </actuator>
    </transmission>
  </xacro:macro>

  <xacro:wheel prefix="front_left">
    <origin xyz="${wheelbase/2} ${track/2} ${wheel_vertical_offset}" rpy="0 0 0" />
  </xacro:wheel>
  <xacro:wheel prefix="front_right">
    <origin xyz="${wheelbase/2} ${-track/2} ${wheel_vertical_offset}" rpy="0 0 0" />
  </xacro:wheel>
  <xacro:wheel prefix="rear_left">
    <origin xyz="${-wheelbase/2} ${track/2} ${wheel_vertical_offset}" rpy="0 0 0" />
  </xacro:wheel>
  <xacro:wheel ...
(more)
edit retag flag offensive close merge delete

Comments

1

do you have the transformation between the frame of your laser and another frame of your robot like base_link ?

kesuke gravatar image kesuke  ( 2018-07-13 07:43:40 -0600 )edit

I have a transformation between front_laser and chassis_link which I think would be sufficient but the hokuyo_node adds messages to "laser" if I'm not mistaken. I could be wrong, I'm very new to ROS

dkrivet gravatar image dkrivet  ( 2018-07-13 08:08:14 -0600 )edit

when you run rviz what do you put on the fixed frame ? do you see any laser data on rviz ?

kesuke gravatar image kesuke  ( 2018-07-13 08:26:24 -0600 )edit

No I am not able to see the laser data in Rviz. I just get the error as mentioned above:Transform [sender=unknown_publisher] For frame [laser]:Frame [laser] does not exist

dkrivet gravatar image dkrivet  ( 2018-07-13 08:27:36 -0600 )edit

However when I do rostopic echo /front/scan I am able to confirm that the laser is indeed publishing data to the /front/scan topic

dkrivet gravatar image dkrivet  ( 2018-07-13 08:31:15 -0600 )edit

ok so run hokuyo node and rviz , on the fixed frame type the word ( laser ) and tell meif you see laser data on rviz

kesuke gravatar image kesuke  ( 2018-07-13 08:32:36 -0600 )edit

Sorry where do I type laser? I don't see the drop down menu for fixed frame. so sorry, I am very very new to ROS

dkrivet gravatar image dkrivet  ( 2018-07-13 08:43:04 -0600 )edit

on rviz on the section " fixed frame " if you can't see 'laser' type it with manually with your keyboard

kesuke gravatar image kesuke  ( 2018-07-13 08:45:02 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-20 16:58:15 -0600

ahendrix gravatar image

A previous version of the hokuyo_node wiki page documented the available ROS parameters; among them is one for setting the published frame id: frame_id.

You can supply this parameter when you run the node with rosrun like this;

rosrun hokuyo_node hokuyo_node scan:=/front/scan _frame_id:=/front_laser
edit flag offensive delete link more

Comments

I've fixed the hokuyo_node wiki page so that it now displays the full set of ROS parameters again.

ahendrix gravatar image ahendrix  ( 2018-11-20 16:59:48 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-07-13 05:24:32 -0600

Seen: 788 times

Last updated: Nov 20 '18