How do you publish Hokuyo laser data to a specific frame?
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 ...
do you have the transformation between the frame of your laser and another frame of your robot like base_link ?
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
when you run rviz what do you put on the fixed frame ? do you see any laser data on rviz ?
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
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
ok so run hokuyo node and rviz , on the fixed frame type the word ( laser ) and tell meif you see laser data on rviz
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
on rviz on the section " fixed frame " if you can't see 'laser' type it with manually with your keyboard