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

How to define the hardware interface of imu_sensor_controller in urdf?

asked 2020-06-03 02:22:51 -0500

ylh gravatar image

My robot need the imu_sensor_controller to simulation(ubuntu16.04 ros-kinetic) ,but I don't know how to define the interface in urdf suitably. when defined like :

<transmission name="dummy_imu_trans">
     <type>transmission_interface/SimpleTransmission</type>
      <actuator name="dummy_imu_motor">
      <mechanicalReduction>1</mechanicalReduction>
     </actuator>
     <joint name="imu_joint">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
     </joint>
</transmission>

I get:

[ERROR] [1591166801.075328037, 0.267000000]: This controller requires a hardware interface of type 'hardware_interface::ImuSensorInterface'. Make sure this is registered in the hardware_interface::RobotHW class.
[ERROR] [1591166801.075388813, 0.267000000]: Initializing controller 'imu_sensor_controller' failed
[ERROR] [1591166802.076290, 1.182000]: Failed to load imu_sensor_controller
[INFO] [1591166802.076768, 1.182000]: Controller Spawner: Loaded controllers: joint_state_controller, mobile_base_controller
[INFO] [1591166802.096104, 1.197000]: Started controllers: joint_state_controller, mobile_base_controller

Then,I change it like this:

<transmission name="dummy_imu_trans">
        <type>transmission_interface/SimpleTransmission</type>
         <actuator name="dummy_imu_motor">
         <mechanicalReduction>1</mechanicalReduction>
         </actuator>
        <joint name="imu_joint">
        <hardwareInterface>hardware_interface/ImuSensorInterface</hardwareInterface>
        </joint>
</transmission>

Now,I get:

[FATAL] [1591166695.521981171, 0.001000000]: No matching hardware interface found for '>hardware_interface/ImuSensorInterface' while loading interfaces for imu_joint
[FATAL] [1591166695.522106417, 0.001000000]: Could not initialize robot simulation interface

......

[WARN] [1591166723.912112, 23.884000]: Controller Spawner couldn't find the expected controller_manager ROS interface.

I am looking forward to your reply.Thank you in advance.

edit retag flag offensive close merge delete

Comments

I have been checking the imu_sensor_controller packagen and seems like you are using the correct HI tool.

Maybe a missing dependency?

just in case, i think the dependencies should be:

sudo apt-get install ros-kinetic-ros-controllers ros-kinetic-hardware-interface
Solrac3589 gravatar image Solrac3589  ( 2020-06-03 02:38:00 -0500 )edit

Thanks for your reply.I have a try as what you said ,but those are the newest version.Maybe other reasons.

ylh gravatar image ylh  ( 2020-06-03 02:59:02 -0500 )edit

I don't believe IMUs are typically exposed via gazebo_ros_control, but added directly as a sensor plugin in your Gazebo model.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-03 03:10:45 -0500 )edit

Thanks for your reply! I get it what you said,but I need a [imu _sensor_controlle].(http://docs.ros.o...

<transmission name="dummy_imu_trans">
     <type>transmission_interface/SimpleTransmission</type>
      <actuator name="dummy_imu_motor">
      <mechanicalReduction>1</mechanicalReduction>
     </actuator>
     <joint name="imu_joint">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
     </joint>
</transmission>

In the first way, I wrote it based on a successful autonomous navigation case, but I directly rewrote the parameters and did not load the imu controller in, which made the deviation of my robot larger due to skidding and the increase of simulation time.

ylh gravatar image ylh  ( 2020-06-03 03:40:07 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-06-03 22:38:57 -0500

ylh gravatar image

I have found the reason! The original author said that this imu hardware_interface is secondary development, needs to use a specific package, and defined suitably in urdf.So,I went back to the original writing and changed it in urdf: from

<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>

to

<robotSimType>gazebo_ros_control/AKRobotHWSim</robotSimType>

Then,I get:

[INFO] [1591240645.041221, 0.387000]: Started controllers: joint_state_controller, mobile_base_controller, imu_sensor_controller

However, as a newcomer, it is not clear how to carry out the secondary development of ROS. If there are relevant cases recommended, thank you very much

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-06-03 02:22:51 -0500

Seen: 794 times

Last updated: Jun 03 '20