Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Robot links collapse into origin

I'm using ubuntu 16.04 on a Huawei Matebook-x, with kernel 4.15.0-91-generic. ROS distro: kinetic and version 1.12.14. Gazebo 7.

My package for the robot is at https://github.com/yiyinglai/FetchIt_....

I have seen answers and videos about similar problem, and I did what's suggested for the inertia calculation for niryo_gripper.urdf.xacro using the following script.

def inertia(m, x, y, z):
    """Solid cuboid of height h, width w, and length l, and mass m."""
    Ixx = m * (y**2 + z**2) / 12
    Iyy = m * (x**2 + z**2) / 12
    Izz = m * (x**2 + y**2) / 12
    tag = '<inertia ixx="{}" ixy="0.0" ixz="0.0" iyy="{}" iyz="0.0" izz="{}"/>'.format(Ixx, Iyy, Izz)
    return tag


if __name__ == '__main__':
    # mainsupport mass bounding box x, y, z
    print('mainsupport')
    print(inertia(0.01306, 0.0446, 0.0511, 0.044))

    print('left gear')
    print(inertia(0.0043, 0.022038, 0.049874, 0.01155))

    print('right gear')
    print(inertia(0.00375, 0.02207, 0.049804, 0.008))

    print('rod')
    print(inertia(0.00214, 0.012501, 0.041893, 0.016))

    print('clamp')
    print(inertia(0.00662, 0.027452, 0.06758, 0.016))

    print('motor')
    print(inertia(0.01658, 0.036, 0.024, 0.027))

When I launch gazebo simulation, I get a quite normal output on console:

... logging to /home/yiying/.ros/log/881f6094-6f12-11ea-b6cd-7c11cb4ab0c1/roslaunch-matebook-x-3897.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://matebook-x:44093/

SUMMARY
========

PARAMETERS
 * /robot_description: <?xml version="1....
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    spawn_urdf (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [3922]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 881f6094-6f12-11ea-b6cd-7c11cb4ab0c1
process[rosout-1]: started with pid [3935]
started core service [/rosout]
process[gazebo-2]: started with pid [3939]
process[gazebo_gui-3]: started with pid [3964]
process[spawn_urdf-4]: started with pid [4005]
Gazebo multi-robot simulator, version 7.0.0
Copyright (C) 2012-2016 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Gazebo multi-robot simulator, version 7.0.0
Copyright (C) 2012-2016 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[ INFO] [1585193598.698783796]: Finished loading Gazebo ROS API Plugin.
[Msg] Waiting for master.
[ INFO] [1585193598.700128591]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.2.31
[ INFO] [1585193598.751193527]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1585193598.751826873]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.2.31
SpawnModel script started
[INFO] [1585193598.978037, 0.000000]: Loading model XML from ros parameter
[INFO] [1585193598.981118, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[ INFO] [1585193599.212867836, 0.022000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1585193599.250930627, 0.060000000]: Physics dynamic reconfigure ready.
[INFO] [1585193599.286868, 0.090000]: Calling service /gazebo/spawn_urdf_model
[INFO] [1585193599.446658, 0.147000]: Spawn status: SpawnModel: Successfully spawned entity
[ INFO] [1585193599.594736722, 0.147000000]: Loading gazebo_ros_control plugin
[ERROR] [1585193599.594865205, 0.147000000]: GazeboRosControlPlugin missing <legacyModeNS> while using DefaultRobotHWSim, defaults to true.
This setting assumes you have an old package with an old implementation of DefaultRobotHWSim, where the robotNamespace is disregarded and absolute paths are used instead.
If you do not want to fix this issue in an old package just set <legacyModeNS> to true.

[ INFO] [1585193599.594952933, 0.147000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1585193599.596227126, 0.147000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[spawn_urdf-4] process has finished cleanly
log file: /home/yiying/.ros/log/881f6094-6f12-11ea-b6cd-7c11cb4ab0c1/spawn_urdf-4*.log
[ INFO] [1585193599.718851948, 0.147000000]: Loaded gazebo_ros_control.
[ INFO] [1585193599.741055324, 0.170000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1585193599.790204603, 0.217000000]: Physics dynamic reconfigure ready.

In gazebo, except for the mainsupport link, all the links collapse into the origin as shown in the figure below: initial

As soon as I go to editor, console outputs the following:

Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
[Err] [JointMaker.cc:1465] Unable to load joint. Joint child / parent not found

and the model in editor looks normal, as shown below: editor

Links are at the correct positon. And if I exit editor without doing anything and reset gazebo simulation (in either sequence) using

rosservice call /gazebo/reset_simulation

, the robot appears correctly as shown below: after

Inspecting the inertia, it seems pretty normal. inertia

Thank you in advance for helping me out!

Edit #1: I misunderstood what reset_simulation does and found out if I unpause physics, the links implode just like in the first screenshot.

Robot links collapse into implode to origin

I'm using ubuntu 16.04 on a Huawei Matebook-x, with kernel 4.15.0-91-generic. ROS distro: kinetic and version 1.12.14. Gazebo 7.

My package for the robot is at https://github.com/yiyinglai/FetchIt_....

I have seen answers and videos about similar problem, and I did what's suggested for the inertia calculation for niryo_gripper.urdf.xacro using the following script.

def inertia(m, x, y, z):
    """Solid cuboid of height h, width w, and length l, and mass m."""
    Ixx = m * (y**2 + z**2) / 12
    Iyy = m * (x**2 + z**2) / 12
    Izz = m * (x**2 + y**2) / 12
    tag = '<inertia ixx="{}" ixy="0.0" ixz="0.0" iyy="{}" iyz="0.0" izz="{}"/>'.format(Ixx, Iyy, Izz)
    return tag


if __name__ == '__main__':
    # mainsupport mass bounding box x, y, z
    print('mainsupport')
    print(inertia(0.01306, 0.0446, 0.0511, 0.044))

    print('left gear')
    print(inertia(0.0043, 0.022038, 0.049874, 0.01155))

    print('right gear')
    print(inertia(0.00375, 0.02207, 0.049804, 0.008))

    print('rod')
    print(inertia(0.00214, 0.012501, 0.041893, 0.016))

    print('clamp')
    print(inertia(0.00662, 0.027452, 0.06758, 0.016))

    print('motor')
    print(inertia(0.01658, 0.036, 0.024, 0.027))

When I launch gazebo simulation, I get a quite normal output on console:

... logging to /home/yiying/.ros/log/881f6094-6f12-11ea-b6cd-7c11cb4ab0c1/roslaunch-matebook-x-3897.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://matebook-x:44093/

SUMMARY
========

PARAMETERS
 * /robot_description: <?xml version="1....
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    spawn_urdf (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [3922]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 881f6094-6f12-11ea-b6cd-7c11cb4ab0c1
process[rosout-1]: started with pid [3935]
started core service [/rosout]
process[gazebo-2]: started with pid [3939]
process[gazebo_gui-3]: started with pid [3964]
process[spawn_urdf-4]: started with pid [4005]
Gazebo multi-robot simulator, version 7.0.0
Copyright (C) 2012-2016 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Gazebo multi-robot simulator, version 7.0.0
Copyright (C) 2012-2016 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[ INFO] [1585193598.698783796]: Finished loading Gazebo ROS API Plugin.
[Msg] Waiting for master.
[ INFO] [1585193598.700128591]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.2.31
[ INFO] [1585193598.751193527]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1585193598.751826873]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.2.31
SpawnModel script started
[INFO] [1585193598.978037, 0.000000]: Loading model XML from ros parameter
[INFO] [1585193598.981118, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[ INFO] [1585193599.212867836, 0.022000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1585193599.250930627, 0.060000000]: Physics dynamic reconfigure ready.
[INFO] [1585193599.286868, 0.090000]: Calling service /gazebo/spawn_urdf_model
[INFO] [1585193599.446658, 0.147000]: Spawn status: SpawnModel: Successfully spawned entity
[ INFO] [1585193599.594736722, 0.147000000]: Loading gazebo_ros_control plugin
[ERROR] [1585193599.594865205, 0.147000000]: GazeboRosControlPlugin missing <legacyModeNS> while using DefaultRobotHWSim, defaults to true.
This setting assumes you have an old package with an old implementation of DefaultRobotHWSim, where the robotNamespace is disregarded and absolute paths are used instead.
If you do not want to fix this issue in an old package just set <legacyModeNS> to true.

[ INFO] [1585193599.594952933, 0.147000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1585193599.596227126, 0.147000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[spawn_urdf-4] process has finished cleanly
log file: /home/yiying/.ros/log/881f6094-6f12-11ea-b6cd-7c11cb4ab0c1/spawn_urdf-4*.log
[ INFO] [1585193599.718851948, 0.147000000]: Loaded gazebo_ros_control.
[ INFO] [1585193599.741055324, 0.170000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1585193599.790204603, 0.217000000]: Physics dynamic reconfigure ready.

In gazebo, except for the mainsupport link, all the links collapse into the origin as shown in the figure below: initial

As soon as I go to editor, console outputs the following:

Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[velocity].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[acceleration].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
Error [Param.hh:265] Unable to set parameter[wrench].Type type used must have a stream input and outputoperator, which allow boost::lexical_cast tofunction properly.
[Err] [JointMaker.cc:1465] Unable to load joint. Joint child / parent not found

and the model in editor looks normal, as shown below: editor

Links are at the correct positon. And if I exit editor without doing anything and reset gazebo simulation (in either sequence) using

rosservice call /gazebo/reset_simulation

, the robot appears correctly as shown below: after

Inspecting the inertia, it seems pretty normal. inertia

Thank you in advance for helping me out!

Edit #1: I misunderstood what reset_simulation does and found out if I unpause physics, the links implode just like in the first screenshot.

Edit #2: I made all inertia values of the links three time magnitude larger than the original ones. It's not ideal, but the implosion does not occure now. The gripper package will be deleted and it will appear in the niryo_one package. Question closed.