Tag Archives: matlab
About gazebo-Cosimulation problems
i running there commands
cd /home/user/src/GazeboPlugin/export
export SVGA_VGPU10=0
gazebo /home/user/worlds/Ur10BasicWithPlugin.world –verbose
have some problems!
my Ur10BasicWithPlugin.world
<?xml version="1.0"?>
<sdf version="1.4">
<world name="default">
<include>
<uri>model://ground_plane</uri>
</include>
<include>
<uri>model://sun</uri>
</include>
<light name=’sun’ type=’directional’>
<cast_shadows>1</cast_shadows>
<pose frame=”>0 0 10 0 -0 0</pose>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.2 0.2 0.2 1</specular>
<attenuation>
<range>1000</range>
<constant>0.9</constant>
<linear>0.01</linear>
<quadratic>0.001</quadratic>
</attenuation>
<direction>-0.5 0.1 -0.9</direction>
</light>
<model name=’ground_plane’>
<static>1</static>
<link name=’link’>
<collision name=’collision’>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<surface>
<contact>
<collide_bitmask>65535</collide_bitmask>
<ode/>
</contact>
<friction>
<ode>
<mu>100</mu>
<mu2>50</mu2>
</ode>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’visual’>
<cast_shadows>0</cast_shadows>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<material>
<script>
<uri>file://media/materials/scripts/gazebo.material</uri>
<name>Gazebo/Grey</name>
</script>
</material>
</visual>
<self_collide>0</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
</model>
<gravity>0 0 -9.8</gravity>
<magnetic_field>6e-06 2.3e-05 -4.2e-05</magnetic_field>
<atmosphere type=’adiabatic’/>
<physics name=’default_physics’ default=’0′ type=’ode’>
<max_step_size>0.001</max_step_size>
<real_time_factor>1</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
</physics>
<scene>
<ambient>0.4 0.4 0.4 1</ambient>
<background>0.7 0.7 0.7 1</background>
<shadows>1</shadows>
</scene>
<wind/>
<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
<latitude_deg>0</latitude_deg>
<longitude_deg>0</longitude_deg>
<elevation>0</elevation>
<heading_deg>0</heading_deg>
</spherical_coordinates>
<model name=’robot’>
<link name=’base_link’>
<pose frame=”>0 0 0 0 -0 0</pose>
<inertial>
<pose frame=”>0 0 0 0 -0 0</pose>
<mass>4</mass>
<inertia>
<ixx>0.00610633</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00610633</iyy>
<iyz>0</iyz>
<izz>0.01125</izz>
</inertia>
</inertial>
<collision name=’base_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/base.stl</uri>
</mesh>
</geometry>
<max_contacts>10</max_contacts>
<surface>
<contact>
<ode/>
</contact>
<bounce/>
<friction>
<torsional>
<ode/>
</torsional>
<ode/>
</friction>
</surface>
</collision>
<visual name=’base_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/base.dae</uri>
</mesh>
</geometry>
</visual>
<self_collide>0</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’world_joint’ type=’fixed’>
<child>base_link</child>
<parent>world</parent>
</joint>
<link name=’shoulder_link’>
<pose frame=”>0 0 0.1273 0 -0 0</pose>
<inertial>
<pose frame=”>0 0 0 0 -0 0</pose>
<mass>7.778</mass>
<inertia>
<ixx>0.0314743</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.0314743</iyy>
<iyz>0</iyz>
<izz>0.0218756</izz>
</inertia>
</inertial>
<collision name=’shoulder_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/shoulder.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’shoulder_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/shoulder.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’shoulder_pan_joint’ type=’revolute’>
<child>shoulder_link</child>
<parent>base_link</parent>
<axis>
<xyz>0 0 1</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>330</effort>
<velocity>2.16</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’upper_arm_link’>
<pose frame=”>0 0.220941 0.1273 3.14159 1.57079 3.14159</pose>
<inertial>
<pose frame=”>0 -0.045 0.306 0 -0 0</pose>
<mass>12.93</mass>
<inertia>
<ixx>0.421754</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.421754</iyy>
<iyz>0</iyz>
<izz>0.0363656</izz>
</inertia>
</inertial>
<collision name=’upper_arm_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/upperarm.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’upper_arm_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/upperarm.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’shoulder_lift_joint’ type=’revolute’>
<child>upper_arm_link</child>
<parent>shoulder_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>330</effort>
<velocity>2.16</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’forearm_link’>
<pose frame=”>0.612 0.049041 0.1273 3.14159 1.57079 3.14159</pose>
<inertial>
<pose frame=”>0 0 0.28615 0 -0 0</pose>
<mass>3.87</mass>
<inertia>
<ixx>0.11107</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.11107</iyy>
<iyz>0</iyz>
<izz>0.0108844</izz>
</inertia>
</inertial>
<collision name=’forearm_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/forearm.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’forearm_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/forearm.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’elbow_joint’ type=’revolute’>
<child>forearm_link</child>
<parent>upper_arm_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-3.14159</lower>
<upper>3.14159</upper>
<effort>150</effort>
<velocity>3.15</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’wrist_1_link’>
<pose frame=”>1.1843 0.049041 0.1273 3.14159 -0 3.14159</pose>
<inertial>
<pose frame=”>0 0.1149 0 0 -0 0</pose>
<mass>1.96</mass>
<inertia>
<ixx>0.00510825</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00510825</iyy>
<iyz>0</iyz>
<izz>0.0055125</izz>
</inertia>
</inertial>
<collision name=’wrist_1_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/wrist1.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’wrist_1_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/wrist1.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’wrist_1_joint’ type=’revolute’>
<child>wrist_1_link</child>
<parent>forearm_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>54</effort>
<velocity>3.2</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’wrist_2_link’>
<pose frame=”>1.1843 0.163941 0.1273 3.14159 -0 3.14159</pose>
<inertial>
<pose frame=”>0 0 0.1157 0 -0 0</pose>
<mass>1.96</mass>
<inertia>
<ixx>0.00510825</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00510825</iyy>
<iyz>0</iyz>
<izz>0.0055125</izz>
</inertia>
</inertial>
<collision name=’wrist_2_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/wrist2.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’wrist_2_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/wrist2.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’wrist_2_joint’ type=’revolute’>
<child>wrist_2_link</child>
<parent>wrist_1_link</parent>
<axis>
<xyz>0 0 1</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>54</effort>
<velocity>3.2</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’wrist_3_link’>
<pose frame=”>1.1843 0.163941 0.0116 3.14159 -0 3.14159</pose>
<inertial>
<pose frame=”>0 0.07695 0 1.5708 -0 0</pose>
<mass>0.202</mass>
<inertia>
<ixx>0.000117922</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.000117922</iyy>
<iyz>0</iyz>
<izz>0.000204525</izz>
</inertia>
</inertial>
<collision name=’wrist_3_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/wrist3.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<collision name=’wrist_3_link_fixed_joint_lump__ee_link_collision_1′>
<pose frame=”>-0 0.0822 0 0 -0 1.5708</pose>
<geometry>
<box>
<size>0.01 0.01 0.01</size>
</box>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’wrist_3_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/wrist3.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<velocity_decay/>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’wrist_3_joint’ type=’revolute’>
<child>wrist_3_link</child>
<parent>wrist_2_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>54</effort>
<velocity>3.2</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<static>0</static>
<plugin name=’ros_control’ filename=’libgazebo_ros_control.so’>
<robotNamespace>/</robotNamespace>
</plugin>
<pose frame=”>0 0 0.1 0 -0 0</pose>
</model>
<state world_name=’default’>
<sim_time>276 385000000</sim_time>
<real_time>279 318272940</real_time>
<wall_time>1655637837 737929799</wall_time>
<iterations>276385</iterations>
<model name=’ground_plane’>
<pose frame=”>0 0 0 0 -0 0</pose>
<scale>1 1 1</scale>
<link name=’link’>
<pose frame=”>0 0 0 0 -0 0</pose>
<velocity>0 0 0 0 -0 0</velocity>
<acceleration>0 0 0 0 -0 0</acceleration>
<wrench>0 0 0 0 -0 0</wrench>
</link>
</model>
<model name=’robot’>
<pose frame=”>0 0 0.1 4.9e-05 -0.000225 -0</pose>
<scale>1 1 1</scale>
<link name=’base_link’>
<pose frame=”>0 0 0.1 4.9e-05 -0.000225 -0</pose>
<velocity>0 -0 0 0 -0 0</velocity>
<acceleration>0 -0 0 0 -0 0</acceleration>
<wrench>0 -0 0 0 -0 0</wrench>
</link>
<link name=’forearm_link’>
<pose frame=”>0.611968 0.048722 0.221459 -3.12712 1.56111 -3.12763</pose>
<velocity>-0.000156 -0.000125 -0.017466 1.5e-05 0.029121 -0.000204</velocity>
<acceleration>-0 0 -0 -5e-06 0 0</acceleration>
<wrench>-0 0 -1e-06 0 -0 0</wrench>
</link>
<link name=’shoulder_link’>
<pose frame=”>-2.9e-05 -7e-06 0.227299 -0.000104 0.00048 -0.000507</pose>
<velocity>-0 -0 -0 -0 -0 -0.000199</velocity>
<acceleration>-0 -0 -0 0 -0 0</acceleration>
<wrench>-0 -0 -0 0 -0 0</wrench>
</link>
<link name=’upper_arm_link’>
<pose frame=”>8.3e-05 0.220934 0.227261 -3.12547 1.56128 -3.12597</pose>
<velocity>4.4e-05 -0 -0 1.4e-05 0.02854 -0.000204</velocity>
<acceleration>-0 -0 -0 -6e-06 0 0</acceleration>
<wrench>-0 -0 -3e-06 0 -0 0</wrench>
</link>
<link name=’wrist_1_link’>
<pose frame=”>1.18424 0.048431 0.215911 -3.14145 -0.010088 3.14108</pose>
<velocity>-0.000318 -0.000241 -0.034131 1.5e-05 0.030466 -0.000204</velocity>
<acceleration>-0 0 -1e-06 0 1e-06 0</acceleration>
<wrench>-0 0 -1e-06 0 -0 0</wrench>
</link>
<link name=’wrist_2_link’>
<pose frame=”>1.1843 0.16333 0.215893 -3.14144 -0.010089 3.14109</pose>
<velocity>-0.000295 -0.000241 -0.034131 1.6e-05 0.030466 -0.000172</velocity>
<acceleration>1e-06 -0 -1e-06 0 -1e-06 0</acceleration>
<wrench>1e-06 -0 -1e-06 0 -0 0</wrench>
</link>
<link name=’wrist_3_link’>
<pose frame=”>1.18313 0.163313 0.100192 -3.14146 -0.010125 3.14109</pose>
<velocity>-0.00382 -0.000239 -0.034095 1.6e-05 0.030523 -0.000172</velocity>
<acceleration>1e-06 -0 2.3e-05 -6e-06 1e-06 -6e-06</acceleration>
<wrench>0 -0 5e-06 0 -0 0</wrench>
</link>
</model>
<light name=’sun’>
<pose frame=”>0 0 10 0 -0 0</pose>
</light>
</state>
<gui fullscreen=’0′>
<camera name=’user_camera’>
<pose frame=”>5 -5 2 0 0.275643 2.35619</pose>
<view_controller>orbit</view_controller>
<projection_type>perspective</projection_type>
</camera>
</gui>
<plugin name="GazeboPlugin" filename="lib/libGazeboCoSimPlugin.so"><portNumber>14581</portNumber></plugin>
</world>
</sdf>
my .so file
i have some question
how to build my Ur10BasicWithPlugin.world
how to solve the problem of terminal displayi running there commands
cd /home/user/src/GazeboPlugin/export
export SVGA_VGPU10=0
gazebo /home/user/worlds/Ur10BasicWithPlugin.world –verbose
have some problems!
my Ur10BasicWithPlugin.world
<?xml version="1.0"?>
<sdf version="1.4">
<world name="default">
<include>
<uri>model://ground_plane</uri>
</include>
<include>
<uri>model://sun</uri>
</include>
<light name=’sun’ type=’directional’>
<cast_shadows>1</cast_shadows>
<pose frame=”>0 0 10 0 -0 0</pose>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.2 0.2 0.2 1</specular>
<attenuation>
<range>1000</range>
<constant>0.9</constant>
<linear>0.01</linear>
<quadratic>0.001</quadratic>
</attenuation>
<direction>-0.5 0.1 -0.9</direction>
</light>
<model name=’ground_plane’>
<static>1</static>
<link name=’link’>
<collision name=’collision’>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<surface>
<contact>
<collide_bitmask>65535</collide_bitmask>
<ode/>
</contact>
<friction>
<ode>
<mu>100</mu>
<mu2>50</mu2>
</ode>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’visual’>
<cast_shadows>0</cast_shadows>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<material>
<script>
<uri>file://media/materials/scripts/gazebo.material</uri>
<name>Gazebo/Grey</name>
</script>
</material>
</visual>
<self_collide>0</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
</model>
<gravity>0 0 -9.8</gravity>
<magnetic_field>6e-06 2.3e-05 -4.2e-05</magnetic_field>
<atmosphere type=’adiabatic’/>
<physics name=’default_physics’ default=’0′ type=’ode’>
<max_step_size>0.001</max_step_size>
<real_time_factor>1</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
</physics>
<scene>
<ambient>0.4 0.4 0.4 1</ambient>
<background>0.7 0.7 0.7 1</background>
<shadows>1</shadows>
</scene>
<wind/>
<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
<latitude_deg>0</latitude_deg>
<longitude_deg>0</longitude_deg>
<elevation>0</elevation>
<heading_deg>0</heading_deg>
</spherical_coordinates>
<model name=’robot’>
<link name=’base_link’>
<pose frame=”>0 0 0 0 -0 0</pose>
<inertial>
<pose frame=”>0 0 0 0 -0 0</pose>
<mass>4</mass>
<inertia>
<ixx>0.00610633</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00610633</iyy>
<iyz>0</iyz>
<izz>0.01125</izz>
</inertia>
</inertial>
<collision name=’base_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/base.stl</uri>
</mesh>
</geometry>
<max_contacts>10</max_contacts>
<surface>
<contact>
<ode/>
</contact>
<bounce/>
<friction>
<torsional>
<ode/>
</torsional>
<ode/>
</friction>
</surface>
</collision>
<visual name=’base_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/base.dae</uri>
</mesh>
</geometry>
</visual>
<self_collide>0</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’world_joint’ type=’fixed’>
<child>base_link</child>
<parent>world</parent>
</joint>
<link name=’shoulder_link’>
<pose frame=”>0 0 0.1273 0 -0 0</pose>
<inertial>
<pose frame=”>0 0 0 0 -0 0</pose>
<mass>7.778</mass>
<inertia>
<ixx>0.0314743</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.0314743</iyy>
<iyz>0</iyz>
<izz>0.0218756</izz>
</inertia>
</inertial>
<collision name=’shoulder_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/shoulder.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’shoulder_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/shoulder.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’shoulder_pan_joint’ type=’revolute’>
<child>shoulder_link</child>
<parent>base_link</parent>
<axis>
<xyz>0 0 1</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>330</effort>
<velocity>2.16</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’upper_arm_link’>
<pose frame=”>0 0.220941 0.1273 3.14159 1.57079 3.14159</pose>
<inertial>
<pose frame=”>0 -0.045 0.306 0 -0 0</pose>
<mass>12.93</mass>
<inertia>
<ixx>0.421754</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.421754</iyy>
<iyz>0</iyz>
<izz>0.0363656</izz>
</inertia>
</inertial>
<collision name=’upper_arm_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/upperarm.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’upper_arm_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/upperarm.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’shoulder_lift_joint’ type=’revolute’>
<child>upper_arm_link</child>
<parent>shoulder_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>330</effort>
<velocity>2.16</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’forearm_link’>
<pose frame=”>0.612 0.049041 0.1273 3.14159 1.57079 3.14159</pose>
<inertial>
<pose frame=”>0 0 0.28615 0 -0 0</pose>
<mass>3.87</mass>
<inertia>
<ixx>0.11107</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.11107</iyy>
<iyz>0</iyz>
<izz>0.0108844</izz>
</inertia>
</inertial>
<collision name=’forearm_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/forearm.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’forearm_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/forearm.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’elbow_joint’ type=’revolute’>
<child>forearm_link</child>
<parent>upper_arm_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-3.14159</lower>
<upper>3.14159</upper>
<effort>150</effort>
<velocity>3.15</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’wrist_1_link’>
<pose frame=”>1.1843 0.049041 0.1273 3.14159 -0 3.14159</pose>
<inertial>
<pose frame=”>0 0.1149 0 0 -0 0</pose>
<mass>1.96</mass>
<inertia>
<ixx>0.00510825</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00510825</iyy>
<iyz>0</iyz>
<izz>0.0055125</izz>
</inertia>
</inertial>
<collision name=’wrist_1_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/wrist1.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’wrist_1_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/wrist1.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’wrist_1_joint’ type=’revolute’>
<child>wrist_1_link</child>
<parent>forearm_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>54</effort>
<velocity>3.2</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’wrist_2_link’>
<pose frame=”>1.1843 0.163941 0.1273 3.14159 -0 3.14159</pose>
<inertial>
<pose frame=”>0 0 0.1157 0 -0 0</pose>
<mass>1.96</mass>
<inertia>
<ixx>0.00510825</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00510825</iyy>
<iyz>0</iyz>
<izz>0.0055125</izz>
</inertia>
</inertial>
<collision name=’wrist_2_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/wrist2.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’wrist_2_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/wrist2.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’wrist_2_joint’ type=’revolute’>
<child>wrist_2_link</child>
<parent>wrist_1_link</parent>
<axis>
<xyz>0 0 1</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>54</effort>
<velocity>3.2</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’wrist_3_link’>
<pose frame=”>1.1843 0.163941 0.0116 3.14159 -0 3.14159</pose>
<inertial>
<pose frame=”>0 0.07695 0 1.5708 -0 0</pose>
<mass>0.202</mass>
<inertia>
<ixx>0.000117922</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.000117922</iyy>
<iyz>0</iyz>
<izz>0.000204525</izz>
</inertia>
</inertial>
<collision name=’wrist_3_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/wrist3.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<collision name=’wrist_3_link_fixed_joint_lump__ee_link_collision_1′>
<pose frame=”>-0 0.0822 0 0 -0 1.5708</pose>
<geometry>
<box>
<size>0.01 0.01 0.01</size>
</box>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’wrist_3_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/wrist3.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<velocity_decay/>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’wrist_3_joint’ type=’revolute’>
<child>wrist_3_link</child>
<parent>wrist_2_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>54</effort>
<velocity>3.2</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<static>0</static>
<plugin name=’ros_control’ filename=’libgazebo_ros_control.so’>
<robotNamespace>/</robotNamespace>
</plugin>
<pose frame=”>0 0 0.1 0 -0 0</pose>
</model>
<state world_name=’default’>
<sim_time>276 385000000</sim_time>
<real_time>279 318272940</real_time>
<wall_time>1655637837 737929799</wall_time>
<iterations>276385</iterations>
<model name=’ground_plane’>
<pose frame=”>0 0 0 0 -0 0</pose>
<scale>1 1 1</scale>
<link name=’link’>
<pose frame=”>0 0 0 0 -0 0</pose>
<velocity>0 0 0 0 -0 0</velocity>
<acceleration>0 0 0 0 -0 0</acceleration>
<wrench>0 0 0 0 -0 0</wrench>
</link>
</model>
<model name=’robot’>
<pose frame=”>0 0 0.1 4.9e-05 -0.000225 -0</pose>
<scale>1 1 1</scale>
<link name=’base_link’>
<pose frame=”>0 0 0.1 4.9e-05 -0.000225 -0</pose>
<velocity>0 -0 0 0 -0 0</velocity>
<acceleration>0 -0 0 0 -0 0</acceleration>
<wrench>0 -0 0 0 -0 0</wrench>
</link>
<link name=’forearm_link’>
<pose frame=”>0.611968 0.048722 0.221459 -3.12712 1.56111 -3.12763</pose>
<velocity>-0.000156 -0.000125 -0.017466 1.5e-05 0.029121 -0.000204</velocity>
<acceleration>-0 0 -0 -5e-06 0 0</acceleration>
<wrench>-0 0 -1e-06 0 -0 0</wrench>
</link>
<link name=’shoulder_link’>
<pose frame=”>-2.9e-05 -7e-06 0.227299 -0.000104 0.00048 -0.000507</pose>
<velocity>-0 -0 -0 -0 -0 -0.000199</velocity>
<acceleration>-0 -0 -0 0 -0 0</acceleration>
<wrench>-0 -0 -0 0 -0 0</wrench>
</link>
<link name=’upper_arm_link’>
<pose frame=”>8.3e-05 0.220934 0.227261 -3.12547 1.56128 -3.12597</pose>
<velocity>4.4e-05 -0 -0 1.4e-05 0.02854 -0.000204</velocity>
<acceleration>-0 -0 -0 -6e-06 0 0</acceleration>
<wrench>-0 -0 -3e-06 0 -0 0</wrench>
</link>
<link name=’wrist_1_link’>
<pose frame=”>1.18424 0.048431 0.215911 -3.14145 -0.010088 3.14108</pose>
<velocity>-0.000318 -0.000241 -0.034131 1.5e-05 0.030466 -0.000204</velocity>
<acceleration>-0 0 -1e-06 0 1e-06 0</acceleration>
<wrench>-0 0 -1e-06 0 -0 0</wrench>
</link>
<link name=’wrist_2_link’>
<pose frame=”>1.1843 0.16333 0.215893 -3.14144 -0.010089 3.14109</pose>
<velocity>-0.000295 -0.000241 -0.034131 1.6e-05 0.030466 -0.000172</velocity>
<acceleration>1e-06 -0 -1e-06 0 -1e-06 0</acceleration>
<wrench>1e-06 -0 -1e-06 0 -0 0</wrench>
</link>
<link name=’wrist_3_link’>
<pose frame=”>1.18313 0.163313 0.100192 -3.14146 -0.010125 3.14109</pose>
<velocity>-0.00382 -0.000239 -0.034095 1.6e-05 0.030523 -0.000172</velocity>
<acceleration>1e-06 -0 2.3e-05 -6e-06 1e-06 -6e-06</acceleration>
<wrench>0 -0 5e-06 0 -0 0</wrench>
</link>
</model>
<light name=’sun’>
<pose frame=”>0 0 10 0 -0 0</pose>
</light>
</state>
<gui fullscreen=’0′>
<camera name=’user_camera’>
<pose frame=”>5 -5 2 0 0.275643 2.35619</pose>
<view_controller>orbit</view_controller>
<projection_type>perspective</projection_type>
</camera>
</gui>
<plugin name="GazeboPlugin" filename="lib/libGazeboCoSimPlugin.so"><portNumber>14581</portNumber></plugin>
</world>
</sdf>
my .so file
i have some question
how to build my Ur10BasicWithPlugin.world
how to solve the problem of terminal display i running there commands
cd /home/user/src/GazeboPlugin/export
export SVGA_VGPU10=0
gazebo /home/user/worlds/Ur10BasicWithPlugin.world –verbose
have some problems!
my Ur10BasicWithPlugin.world
<?xml version="1.0"?>
<sdf version="1.4">
<world name="default">
<include>
<uri>model://ground_plane</uri>
</include>
<include>
<uri>model://sun</uri>
</include>
<light name=’sun’ type=’directional’>
<cast_shadows>1</cast_shadows>
<pose frame=”>0 0 10 0 -0 0</pose>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.2 0.2 0.2 1</specular>
<attenuation>
<range>1000</range>
<constant>0.9</constant>
<linear>0.01</linear>
<quadratic>0.001</quadratic>
</attenuation>
<direction>-0.5 0.1 -0.9</direction>
</light>
<model name=’ground_plane’>
<static>1</static>
<link name=’link’>
<collision name=’collision’>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<surface>
<contact>
<collide_bitmask>65535</collide_bitmask>
<ode/>
</contact>
<friction>
<ode>
<mu>100</mu>
<mu2>50</mu2>
</ode>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’visual’>
<cast_shadows>0</cast_shadows>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<material>
<script>
<uri>file://media/materials/scripts/gazebo.material</uri>
<name>Gazebo/Grey</name>
</script>
</material>
</visual>
<self_collide>0</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
</model>
<gravity>0 0 -9.8</gravity>
<magnetic_field>6e-06 2.3e-05 -4.2e-05</magnetic_field>
<atmosphere type=’adiabatic’/>
<physics name=’default_physics’ default=’0′ type=’ode’>
<max_step_size>0.001</max_step_size>
<real_time_factor>1</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
</physics>
<scene>
<ambient>0.4 0.4 0.4 1</ambient>
<background>0.7 0.7 0.7 1</background>
<shadows>1</shadows>
</scene>
<wind/>
<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
<latitude_deg>0</latitude_deg>
<longitude_deg>0</longitude_deg>
<elevation>0</elevation>
<heading_deg>0</heading_deg>
</spherical_coordinates>
<model name=’robot’>
<link name=’base_link’>
<pose frame=”>0 0 0 0 -0 0</pose>
<inertial>
<pose frame=”>0 0 0 0 -0 0</pose>
<mass>4</mass>
<inertia>
<ixx>0.00610633</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00610633</iyy>
<iyz>0</iyz>
<izz>0.01125</izz>
</inertia>
</inertial>
<collision name=’base_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/base.stl</uri>
</mesh>
</geometry>
<max_contacts>10</max_contacts>
<surface>
<contact>
<ode/>
</contact>
<bounce/>
<friction>
<torsional>
<ode/>
</torsional>
<ode/>
</friction>
</surface>
</collision>
<visual name=’base_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/base.dae</uri>
</mesh>
</geometry>
</visual>
<self_collide>0</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’world_joint’ type=’fixed’>
<child>base_link</child>
<parent>world</parent>
</joint>
<link name=’shoulder_link’>
<pose frame=”>0 0 0.1273 0 -0 0</pose>
<inertial>
<pose frame=”>0 0 0 0 -0 0</pose>
<mass>7.778</mass>
<inertia>
<ixx>0.0314743</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.0314743</iyy>
<iyz>0</iyz>
<izz>0.0218756</izz>
</inertia>
</inertial>
<collision name=’shoulder_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/shoulder.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’shoulder_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/shoulder.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’shoulder_pan_joint’ type=’revolute’>
<child>shoulder_link</child>
<parent>base_link</parent>
<axis>
<xyz>0 0 1</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>330</effort>
<velocity>2.16</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’upper_arm_link’>
<pose frame=”>0 0.220941 0.1273 3.14159 1.57079 3.14159</pose>
<inertial>
<pose frame=”>0 -0.045 0.306 0 -0 0</pose>
<mass>12.93</mass>
<inertia>
<ixx>0.421754</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.421754</iyy>
<iyz>0</iyz>
<izz>0.0363656</izz>
</inertia>
</inertial>
<collision name=’upper_arm_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/upperarm.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’upper_arm_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/upperarm.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’shoulder_lift_joint’ type=’revolute’>
<child>upper_arm_link</child>
<parent>shoulder_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>330</effort>
<velocity>2.16</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’forearm_link’>
<pose frame=”>0.612 0.049041 0.1273 3.14159 1.57079 3.14159</pose>
<inertial>
<pose frame=”>0 0 0.28615 0 -0 0</pose>
<mass>3.87</mass>
<inertia>
<ixx>0.11107</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.11107</iyy>
<iyz>0</iyz>
<izz>0.0108844</izz>
</inertia>
</inertial>
<collision name=’forearm_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/forearm.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’forearm_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/forearm.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’elbow_joint’ type=’revolute’>
<child>forearm_link</child>
<parent>upper_arm_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-3.14159</lower>
<upper>3.14159</upper>
<effort>150</effort>
<velocity>3.15</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’wrist_1_link’>
<pose frame=”>1.1843 0.049041 0.1273 3.14159 -0 3.14159</pose>
<inertial>
<pose frame=”>0 0.1149 0 0 -0 0</pose>
<mass>1.96</mass>
<inertia>
<ixx>0.00510825</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00510825</iyy>
<iyz>0</iyz>
<izz>0.0055125</izz>
</inertia>
</inertial>
<collision name=’wrist_1_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/wrist1.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’wrist_1_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/wrist1.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’wrist_1_joint’ type=’revolute’>
<child>wrist_1_link</child>
<parent>forearm_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>54</effort>
<velocity>3.2</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’wrist_2_link’>
<pose frame=”>1.1843 0.163941 0.1273 3.14159 -0 3.14159</pose>
<inertial>
<pose frame=”>0 0 0.1157 0 -0 0</pose>
<mass>1.96</mass>
<inertia>
<ixx>0.00510825</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00510825</iyy>
<iyz>0</iyz>
<izz>0.0055125</izz>
</inertia>
</inertial>
<collision name=’wrist_2_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/wrist2.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’wrist_2_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/wrist2.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’wrist_2_joint’ type=’revolute’>
<child>wrist_2_link</child>
<parent>wrist_1_link</parent>
<axis>
<xyz>0 0 1</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>54</effort>
<velocity>3.2</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<link name=’wrist_3_link’>
<pose frame=”>1.1843 0.163941 0.0116 3.14159 -0 3.14159</pose>
<inertial>
<pose frame=”>0 0.07695 0 1.5708 -0 0</pose>
<mass>0.202</mass>
<inertia>
<ixx>0.000117922</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.000117922</iyy>
<iyz>0</iyz>
<izz>0.000204525</izz>
</inertia>
</inertial>
<collision name=’wrist_3_link_collision’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/collision/wrist3.stl</uri>
</mesh>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<collision name=’wrist_3_link_fixed_joint_lump__ee_link_collision_1′>
<pose frame=”>-0 0.0822 0 0 -0 1.5708</pose>
<geometry>
<box>
<size>0.01 0.01 0.01</size>
</box>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
<torsional>
<ode/>
</torsional>
</friction>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name=’wrist_3_link_visual’>
<pose frame=”>0 0 0 0 -0 0</pose>
<geometry>
<mesh>
<scale>1 1 1</scale>
<uri>/home/zhangbo/catkin_ws/src/universal_robot/ur_description/meshes/ur10/visual/wrist3.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<velocity_decay/>
<gravity>1</gravity>
<velocity_decay/>
<self_collide>1</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
<joint name=’wrist_3_joint’ type=’revolute’>
<child>wrist_3_link</child>
<parent>wrist_2_link</parent>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-6.28319</lower>
<upper>6.28319</upper>
<effort>54</effort>
<velocity>3.2</velocity>
</limit>
<dynamics>
<damping>0</damping>
<friction>0</friction>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>0</use_parent_model_frame>
</axis>
</joint>
<static>0</static>
<plugin name=’ros_control’ filename=’libgazebo_ros_control.so’>
<robotNamespace>/</robotNamespace>
</plugin>
<pose frame=”>0 0 0.1 0 -0 0</pose>
</model>
<state world_name=’default’>
<sim_time>276 385000000</sim_time>
<real_time>279 318272940</real_time>
<wall_time>1655637837 737929799</wall_time>
<iterations>276385</iterations>
<model name=’ground_plane’>
<pose frame=”>0 0 0 0 -0 0</pose>
<scale>1 1 1</scale>
<link name=’link’>
<pose frame=”>0 0 0 0 -0 0</pose>
<velocity>0 0 0 0 -0 0</velocity>
<acceleration>0 0 0 0 -0 0</acceleration>
<wrench>0 0 0 0 -0 0</wrench>
</link>
</model>
<model name=’robot’>
<pose frame=”>0 0 0.1 4.9e-05 -0.000225 -0</pose>
<scale>1 1 1</scale>
<link name=’base_link’>
<pose frame=”>0 0 0.1 4.9e-05 -0.000225 -0</pose>
<velocity>0 -0 0 0 -0 0</velocity>
<acceleration>0 -0 0 0 -0 0</acceleration>
<wrench>0 -0 0 0 -0 0</wrench>
</link>
<link name=’forearm_link’>
<pose frame=”>0.611968 0.048722 0.221459 -3.12712 1.56111 -3.12763</pose>
<velocity>-0.000156 -0.000125 -0.017466 1.5e-05 0.029121 -0.000204</velocity>
<acceleration>-0 0 -0 -5e-06 0 0</acceleration>
<wrench>-0 0 -1e-06 0 -0 0</wrench>
</link>
<link name=’shoulder_link’>
<pose frame=”>-2.9e-05 -7e-06 0.227299 -0.000104 0.00048 -0.000507</pose>
<velocity>-0 -0 -0 -0 -0 -0.000199</velocity>
<acceleration>-0 -0 -0 0 -0 0</acceleration>
<wrench>-0 -0 -0 0 -0 0</wrench>
</link>
<link name=’upper_arm_link’>
<pose frame=”>8.3e-05 0.220934 0.227261 -3.12547 1.56128 -3.12597</pose>
<velocity>4.4e-05 -0 -0 1.4e-05 0.02854 -0.000204</velocity>
<acceleration>-0 -0 -0 -6e-06 0 0</acceleration>
<wrench>-0 -0 -3e-06 0 -0 0</wrench>
</link>
<link name=’wrist_1_link’>
<pose frame=”>1.18424 0.048431 0.215911 -3.14145 -0.010088 3.14108</pose>
<velocity>-0.000318 -0.000241 -0.034131 1.5e-05 0.030466 -0.000204</velocity>
<acceleration>-0 0 -1e-06 0 1e-06 0</acceleration>
<wrench>-0 0 -1e-06 0 -0 0</wrench>
</link>
<link name=’wrist_2_link’>
<pose frame=”>1.1843 0.16333 0.215893 -3.14144 -0.010089 3.14109</pose>
<velocity>-0.000295 -0.000241 -0.034131 1.6e-05 0.030466 -0.000172</velocity>
<acceleration>1e-06 -0 -1e-06 0 -1e-06 0</acceleration>
<wrench>1e-06 -0 -1e-06 0 -0 0</wrench>
</link>
<link name=’wrist_3_link’>
<pose frame=”>1.18313 0.163313 0.100192 -3.14146 -0.010125 3.14109</pose>
<velocity>-0.00382 -0.000239 -0.034095 1.6e-05 0.030523 -0.000172</velocity>
<acceleration>1e-06 -0 2.3e-05 -6e-06 1e-06 -6e-06</acceleration>
<wrench>0 -0 5e-06 0 -0 0</wrench>
</link>
</model>
<light name=’sun’>
<pose frame=”>0 0 10 0 -0 0</pose>
</light>
</state>
<gui fullscreen=’0′>
<camera name=’user_camera’>
<pose frame=”>5 -5 2 0 0.275643 2.35619</pose>
<view_controller>orbit</view_controller>
<projection_type>perspective</projection_type>
</camera>
</gui>
<plugin name="GazeboPlugin" filename="lib/libGazeboCoSimPlugin.so"><portNumber>14581</portNumber></plugin>
</world>
</sdf>
my .so file
i have some question
how to build my Ur10BasicWithPlugin.world
how to solve the problem of terminal display gazebo-cosimalation MATLAB Answers — New Questions
Are annotations supported in uifigure objects?
Are annotations supported in uifigures created in AppDesigner?Are annotations supported in uifigures created in AppDesigner? Are annotations supported in uifigures created in AppDesigner? appdesigner, annotation MATLAB Answers — New Questions
would help me please to create special code for this histogram
Hello everybody
would help me please to create special code for this histogram
Obtain the images “einstein.tif”. This is a 490 × 600 Gray scale image with 8-bit pixels. Then use MATLAB to:
(a) Plot a histogram for the image.
(b) Performing Histogram Equalization to the image.
(c) Plot a histogram for the output image.
(d) Display both the original image and the image after applying histogram equalization.
(e) (Hint) Although MATLAB has a histogram functions, write your own code to calculate the histogram and histogram equalization.Hello everybody
would help me please to create special code for this histogram
Obtain the images “einstein.tif”. This is a 490 × 600 Gray scale image with 8-bit pixels. Then use MATLAB to:
(a) Plot a histogram for the image.
(b) Performing Histogram Equalization to the image.
(c) Plot a histogram for the output image.
(d) Display both the original image and the image after applying histogram equalization.
(e) (Hint) Although MATLAB has a histogram functions, write your own code to calculate the histogram and histogram equalization. Hello everybody
would help me please to create special code for this histogram
Obtain the images “einstein.tif”. This is a 490 × 600 Gray scale image with 8-bit pixels. Then use MATLAB to:
(a) Plot a histogram for the image.
(b) Performing Histogram Equalization to the image.
(c) Plot a histogram for the output image.
(d) Display both the original image and the image after applying histogram equalization.
(e) (Hint) Although MATLAB has a histogram functions, write your own code to calculate the histogram and histogram equalization. special, code, histogram MATLAB Answers — New Questions
How do I plot multiple DTED plots without individual axes or legends?
I’m trying to plot 4 sets of DTED (.dt2) files to create a figure that covers 2 degrees of both latitude and longitude (each .dt2 is 1 degree x 1 degree), and I want the 4 sets to be directly next to each other to create a seamless map.
I’m using the following code to load the files:
[grid_3, R3] = readgeoraster("FILENAME.dt2", "OutputType","double"); % bottom left
[grid_4, R4] = readgeoraster("FILENAME.dt2", "OutputType","double"); % bottom right
[grid_2, R2] = readgeoraster("FILENAME.dt2", "OutputType","double"); % top left
[grid_1, R1] = readgeoraster("FILENAME.dt2", "OutputType","double"); % top right
I’ve tried to combine the arrays that hold the DTED points with the following section:
grid_total = zeros([grid.totallength, grid.totalwidth]);
grid_total(1:3601, 1:3601) = grid_2; % top left
grid_total(1:3601, 3602:7202) = grid_1; % top right
grid_total(3602:7202, 1:3601) = grid_3; % bottom left
grid_total(3602:7202, 3602:7202) = grid_4; % bottom right
figure;
worldmap([30,32],[110,112]);
geoshow(grid_total, what_goes_here???, ‘DisplayType’, ‘surface’)
demcmap(grid_total);
But I’ve been unable to combine R1 through R4 to represent the 2×2 degree array. All of R’s members are read-only, so I’m not sure what to do. Using just R1, R2, etc. throws an error since it isn’t compatible with the size of grid_total.
I’ve tried using subplot to plot each DTED plot onto the same figure with this:
% first grid
figure(1);
subplot(2,2,4);
latlim4 = R4.LatitudeLimits;
lonlim4 = R4.LongitudeLimits;
worldmap(latlim4, lonlim4);
geoshow(grid_4,R4, "DisplayType", "surface");
demcmap(grid_4);
hold on
% second grid
subplot(2,2,3);
latlim3 = R3.LatitudeLimits;
lonlim3 = R3.LongitudeLimits;
worldmap(latlim3, lonlim3);
geoshow(grid_3,R3, "DisplayType", "surface");
demcmap(grid_3);
hold on
% third grid
subplot(2,2,1);
latlim2 = R2.LatitudeLimits;
lonlim2 = R2.LongitudeLimits;
worldmap(latlim2, lonlim2);
geoshow(grid_2,R2, "DisplayType", "surface");
demcmap(grid_2);
hold on
% fourth grid
subplot(2,2,2);
latlim1 = R1.LatitudeLimits;
lonlim1 = R1.LongitudeLimits;
worldmap(latlim1, lonlim1);
geoshow(grid_1,R1, "DisplayType", "surface");
demcmap(grid_1);
But they show up separated from each other with their own axes.
Does anyone have advice on how to plot all 4 of these as 1, larger, combined plot?I’m trying to plot 4 sets of DTED (.dt2) files to create a figure that covers 2 degrees of both latitude and longitude (each .dt2 is 1 degree x 1 degree), and I want the 4 sets to be directly next to each other to create a seamless map.
I’m using the following code to load the files:
[grid_3, R3] = readgeoraster("FILENAME.dt2", "OutputType","double"); % bottom left
[grid_4, R4] = readgeoraster("FILENAME.dt2", "OutputType","double"); % bottom right
[grid_2, R2] = readgeoraster("FILENAME.dt2", "OutputType","double"); % top left
[grid_1, R1] = readgeoraster("FILENAME.dt2", "OutputType","double"); % top right
I’ve tried to combine the arrays that hold the DTED points with the following section:
grid_total = zeros([grid.totallength, grid.totalwidth]);
grid_total(1:3601, 1:3601) = grid_2; % top left
grid_total(1:3601, 3602:7202) = grid_1; % top right
grid_total(3602:7202, 1:3601) = grid_3; % bottom left
grid_total(3602:7202, 3602:7202) = grid_4; % bottom right
figure;
worldmap([30,32],[110,112]);
geoshow(grid_total, what_goes_here???, ‘DisplayType’, ‘surface’)
demcmap(grid_total);
But I’ve been unable to combine R1 through R4 to represent the 2×2 degree array. All of R’s members are read-only, so I’m not sure what to do. Using just R1, R2, etc. throws an error since it isn’t compatible with the size of grid_total.
I’ve tried using subplot to plot each DTED plot onto the same figure with this:
% first grid
figure(1);
subplot(2,2,4);
latlim4 = R4.LatitudeLimits;
lonlim4 = R4.LongitudeLimits;
worldmap(latlim4, lonlim4);
geoshow(grid_4,R4, "DisplayType", "surface");
demcmap(grid_4);
hold on
% second grid
subplot(2,2,3);
latlim3 = R3.LatitudeLimits;
lonlim3 = R3.LongitudeLimits;
worldmap(latlim3, lonlim3);
geoshow(grid_3,R3, "DisplayType", "surface");
demcmap(grid_3);
hold on
% third grid
subplot(2,2,1);
latlim2 = R2.LatitudeLimits;
lonlim2 = R2.LongitudeLimits;
worldmap(latlim2, lonlim2);
geoshow(grid_2,R2, "DisplayType", "surface");
demcmap(grid_2);
hold on
% fourth grid
subplot(2,2,2);
latlim1 = R1.LatitudeLimits;
lonlim1 = R1.LongitudeLimits;
worldmap(latlim1, lonlim1);
geoshow(grid_1,R1, "DisplayType", "surface");
demcmap(grid_1);
But they show up separated from each other with their own axes.
Does anyone have advice on how to plot all 4 of these as 1, larger, combined plot? I’m trying to plot 4 sets of DTED (.dt2) files to create a figure that covers 2 degrees of both latitude and longitude (each .dt2 is 1 degree x 1 degree), and I want the 4 sets to be directly next to each other to create a seamless map.
I’m using the following code to load the files:
[grid_3, R3] = readgeoraster("FILENAME.dt2", "OutputType","double"); % bottom left
[grid_4, R4] = readgeoraster("FILENAME.dt2", "OutputType","double"); % bottom right
[grid_2, R2] = readgeoraster("FILENAME.dt2", "OutputType","double"); % top left
[grid_1, R1] = readgeoraster("FILENAME.dt2", "OutputType","double"); % top right
I’ve tried to combine the arrays that hold the DTED points with the following section:
grid_total = zeros([grid.totallength, grid.totalwidth]);
grid_total(1:3601, 1:3601) = grid_2; % top left
grid_total(1:3601, 3602:7202) = grid_1; % top right
grid_total(3602:7202, 1:3601) = grid_3; % bottom left
grid_total(3602:7202, 3602:7202) = grid_4; % bottom right
figure;
worldmap([30,32],[110,112]);
geoshow(grid_total, what_goes_here???, ‘DisplayType’, ‘surface’)
demcmap(grid_total);
But I’ve been unable to combine R1 through R4 to represent the 2×2 degree array. All of R’s members are read-only, so I’m not sure what to do. Using just R1, R2, etc. throws an error since it isn’t compatible with the size of grid_total.
I’ve tried using subplot to plot each DTED plot onto the same figure with this:
% first grid
figure(1);
subplot(2,2,4);
latlim4 = R4.LatitudeLimits;
lonlim4 = R4.LongitudeLimits;
worldmap(latlim4, lonlim4);
geoshow(grid_4,R4, "DisplayType", "surface");
demcmap(grid_4);
hold on
% second grid
subplot(2,2,3);
latlim3 = R3.LatitudeLimits;
lonlim3 = R3.LongitudeLimits;
worldmap(latlim3, lonlim3);
geoshow(grid_3,R3, "DisplayType", "surface");
demcmap(grid_3);
hold on
% third grid
subplot(2,2,1);
latlim2 = R2.LatitudeLimits;
lonlim2 = R2.LongitudeLimits;
worldmap(latlim2, lonlim2);
geoshow(grid_2,R2, "DisplayType", "surface");
demcmap(grid_2);
hold on
% fourth grid
subplot(2,2,2);
latlim1 = R1.LatitudeLimits;
lonlim1 = R1.LongitudeLimits;
worldmap(latlim1, lonlim1);
geoshow(grid_1,R1, "DisplayType", "surface");
demcmap(grid_1);
But they show up separated from each other with their own axes.
Does anyone have advice on how to plot all 4 of these as 1, larger, combined plot? dted, plotting MATLAB Answers — New Questions
Error overwriting array when using Simulink
The following error I get when running the model:
An error occurred while running the simulation and the simulation was terminated
Caused by: Size mismatch for MATLAB expression ‘array’. Expected = 1×100 Actual = 1×1
The model includes two functions: (1) adding and (2) deleting elements from the array in a base workspace. Fixed-step solver is set for the model, so a new elements is added (or an existing element is removed) each tick.
Then, both functions use a class with the following methods: declare the array, add/delete an element, refresh the array. In the functions I use a persistent variable for the class.
The functions and class work properly via Command Window. But that error occurs if the functions call from the Simulink model. It happens when the array refresh method is used.
Instead of using the array refresh method, I tried to use a global variable. It also works to me via the Command Window, however other errors happen to Simulink:
Global declaration not resolved to a Data Store Memory block registered via the Ports and Data Manager.The following error I get when running the model:
An error occurred while running the simulation and the simulation was terminated
Caused by: Size mismatch for MATLAB expression ‘array’. Expected = 1×100 Actual = 1×1
The model includes two functions: (1) adding and (2) deleting elements from the array in a base workspace. Fixed-step solver is set for the model, so a new elements is added (or an existing element is removed) each tick.
Then, both functions use a class with the following methods: declare the array, add/delete an element, refresh the array. In the functions I use a persistent variable for the class.
The functions and class work properly via Command Window. But that error occurs if the functions call from the Simulink model. It happens when the array refresh method is used.
Instead of using the array refresh method, I tried to use a global variable. It also works to me via the Command Window, however other errors happen to Simulink:
Global declaration not resolved to a Data Store Memory block registered via the Ports and Data Manager. The following error I get when running the model:
An error occurred while running the simulation and the simulation was terminated
Caused by: Size mismatch for MATLAB expression ‘array’. Expected = 1×100 Actual = 1×1
The model includes two functions: (1) adding and (2) deleting elements from the array in a base workspace. Fixed-step solver is set for the model, so a new elements is added (or an existing element is removed) each tick.
Then, both functions use a class with the following methods: declare the array, add/delete an element, refresh the array. In the functions I use a persistent variable for the class.
The functions and class work properly via Command Window. But that error occurs if the functions call from the Simulink model. It happens when the array refresh method is used.
Instead of using the array refresh method, I tried to use a global variable. It also works to me via the Command Window, however other errors happen to Simulink:
Global declaration not resolved to a Data Store Memory block registered via the Ports and Data Manager. array, simulink, variable, arrays, variables, class MATLAB Answers — New Questions
How can I “connect” the colorbar to my values of a scatter plot?
How can I "connect" the colorbar to my values (between 0 and 1) of a scatter plot?
a = rand(1000,1);
C = 1-[a a a];
scatter(1:length(a),a,60,C,’fill’)
colormap(C);
colorbar;
Here you can see that the colorbar is not gradually changing from 0 to 1.. How to fix it?How can I "connect" the colorbar to my values (between 0 and 1) of a scatter plot?
a = rand(1000,1);
C = 1-[a a a];
scatter(1:length(a),a,60,C,’fill’)
colormap(C);
colorbar;
Here you can see that the colorbar is not gradually changing from 0 to 1.. How to fix it? How can I "connect" the colorbar to my values (between 0 and 1) of a scatter plot?
a = rand(1000,1);
C = 1-[a a a];
scatter(1:length(a),a,60,C,’fill’)
colormap(C);
colorbar;
Here you can see that the colorbar is not gradually changing from 0 to 1.. How to fix it? colorbar, colormap, scatter MATLAB Answers — New Questions
why do I got such a low score when i use bench function in matlab2024a
when I was using MATLAB 2024A, it often got stuck, and then became normal after a few seconds . this was very different from my previous experience, and I feel my progam runs very slowly. So I ran the bench function and found that the score was terrible, and I don’t understand why this is happending ……when I was using MATLAB 2024A, it often got stuck, and then became normal after a few seconds . this was very different from my previous experience, and I feel my progam runs very slowly. So I ran the bench function and found that the score was terrible, and I don’t understand why this is happending …… when I was using MATLAB 2024A, it often got stuck, and then became normal after a few seconds . this was very different from my previous experience, and I feel my progam runs very slowly. So I ran the bench function and found that the score was terrible, and I don’t understand why this is happending …… bench MATLAB Answers — New Questions
Stateflow use custom C code, while generating C++ using Embedded coder
Hi, I’m using Stateflow inside simulink. I used some C functions as custom code using this article, and also I want to generate a C++ code based on my model and chart using Embedded Coder. The code generates fine, but it can not be compiled because of undefined reference linker error.
After some investigation, I found that there is no extern "C" guard for C header related to custom code in the C++ header of the generated code. After I added extern manually, linker error fixed.
My question, is about some configs or checkbox to use and having C custom code, while generating C++ code (embedded coder).
thanksHi, I’m using Stateflow inside simulink. I used some C functions as custom code using this article, and also I want to generate a C++ code based on my model and chart using Embedded Coder. The code generates fine, but it can not be compiled because of undefined reference linker error.
After some investigation, I found that there is no extern "C" guard for C header related to custom code in the C++ header of the generated code. After I added extern manually, linker error fixed.
My question, is about some configs or checkbox to use and having C custom code, while generating C++ code (embedded coder).
thanks Hi, I’m using Stateflow inside simulink. I used some C functions as custom code using this article, and also I want to generate a C++ code based on my model and chart using Embedded Coder. The code generates fine, but it can not be compiled because of undefined reference linker error.
After some investigation, I found that there is no extern "C" guard for C header related to custom code in the C++ header of the generated code. After I added extern manually, linker error fixed.
My question, is about some configs or checkbox to use and having C custom code, while generating C++ code (embedded coder).
thanks custom code, code generation, linker error, c/c++ MATLAB Answers — New Questions
Downloading EEG LAB Plug Ins
I am trying to download EEG LAB plugins and I keep getting an error code that I do not have permission to do this. Has anyone encountered this? How do I fix it?I am trying to download EEG LAB plugins and I keep getting an error code that I do not have permission to do this. Has anyone encountered this? How do I fix it? I am trying to download EEG LAB plugins and I keep getting an error code that I do not have permission to do this. Has anyone encountered this? How do I fix it? eeglab plugins MATLAB Answers — New Questions
Incorrect results of inverse tall array
Hi,
I am using tall array and testing the inverse of A? (pseudo inverse). The system is linear Ax=b. A:245*9, x: 9*1, b:245*1.
However, with the same matrices, the results of gather(A/b) is incorrect, 1st to 7th elements are NaN, 8th is -inf. The last one is the same with non-tall array results.
A_ds = arrayDatastore([C d], "OutputType","same");
At = tall(A_ds);
A = At(:,1:9);
B1 = At(:,10);
X=AB1; % solve X in equation A*X=B1
X_1=gather(X);
Y=Cd; % solve X in non-tall array, benchmark
Any one can help this case?
Thanks in advance.Hi,
I am using tall array and testing the inverse of A? (pseudo inverse). The system is linear Ax=b. A:245*9, x: 9*1, b:245*1.
However, with the same matrices, the results of gather(A/b) is incorrect, 1st to 7th elements are NaN, 8th is -inf. The last one is the same with non-tall array results.
A_ds = arrayDatastore([C d], "OutputType","same");
At = tall(A_ds);
A = At(:,1:9);
B1 = At(:,10);
X=AB1; % solve X in equation A*X=B1
X_1=gather(X);
Y=Cd; % solve X in non-tall array, benchmark
Any one can help this case?
Thanks in advance. Hi,
I am using tall array and testing the inverse of A? (pseudo inverse). The system is linear Ax=b. A:245*9, x: 9*1, b:245*1.
However, with the same matrices, the results of gather(A/b) is incorrect, 1st to 7th elements are NaN, 8th is -inf. The last one is the same with non-tall array results.
A_ds = arrayDatastore([C d], "OutputType","same");
At = tall(A_ds);
A = At(:,1:9);
B1 = At(:,10);
X=AB1; % solve X in equation A*X=B1
X_1=gather(X);
Y=Cd; % solve X in non-tall array, benchmark
Any one can help this case?
Thanks in advance. matlab, matrix, tall array MATLAB Answers — New Questions
Is there any way to speed up the function `changem`?
I am doing some substitutions of the index of triangle mesh. After removing or selecting some points on the mesh, I need to "retrench" the connectivitylist. I always using changem to achieve this. Like below,
function TR1 = simpleTR(TR)
node_idx = unique(TR.ConnectivityList);
node1 = TR.Points(node_idx,:);
node_idx1 = 1:size(node1,1);
face1 = changem(TR.ConnectivityList,node_idx1′,node_idx);
TR1 = triangulation(face1,node1);
end
I found the speed of this is slow when the input TR is big. In profiling, the code in changem below takes the most of time.
B(A == oldval(k)) = newval(k);
Is there any way to accelerate this?
———————-edit for @Cam Salzberger comment———————————————
I would like to clarify my problem in two aspects. One is the bigger picture, which is what I would like to do with the codes. The other is the problem of changem.
1. The goal of my codes is to make a new triangle mesh. The new mesh has fewer vertices(TR.Points) than the original one, after I deleted some vertex of it. The index of the faces (TR.ConnectivityList) should be "retrench", that is, the range of the faces (TR.ConnectivityList) will be smaller. See the example below, which is from matlab page,triangulation
% the original mesh
P = [ 2.5 8.0
6.5 8.0
2.5 5.0
6.5 5.0
1.0 6.5
8.0 6.5];
T = [5 3 1;
3 2 1;
3 4 2;
4 6 2];
TR = triangulation(T,P)
triplot(TR)
Now I delete the 5th vertex. The new mesh should be,
T_new = [ 3 2 1;
3 4 2;
4 6 2];
TR1a = triangulation(T_new,P);% some vertices is not referenced
TR1b = simpleTR(TR1a); % the content is above
%>> TR1b.Points
ans =
2.5 8
6.5 8
2.5 5
6.5 5
8 6.5
%>> TR1b.ConnectivityList
ans =
3 2 1
3 4 2
4 5 2
In the process, I need to replace "6" with "5" with changem. In practise, I have to changem many number for a large mesh.
2. For the problem of changem. In this function, I found it did a loop for "find" and "change value" combination.
B(A == oldval(k)) = newval(k);
I believe it has some chance to improve. Because it seems in every loop, it traverses through all of the elements in the matrix(TR.ConnectivityList). I think this way may be imperfect. It may use some hashtable-like thing to do it., which could be done in one loop.
All of this is my guess. Thank you for any suggestions.I am doing some substitutions of the index of triangle mesh. After removing or selecting some points on the mesh, I need to "retrench" the connectivitylist. I always using changem to achieve this. Like below,
function TR1 = simpleTR(TR)
node_idx = unique(TR.ConnectivityList);
node1 = TR.Points(node_idx,:);
node_idx1 = 1:size(node1,1);
face1 = changem(TR.ConnectivityList,node_idx1′,node_idx);
TR1 = triangulation(face1,node1);
end
I found the speed of this is slow when the input TR is big. In profiling, the code in changem below takes the most of time.
B(A == oldval(k)) = newval(k);
Is there any way to accelerate this?
———————-edit for @Cam Salzberger comment———————————————
I would like to clarify my problem in two aspects. One is the bigger picture, which is what I would like to do with the codes. The other is the problem of changem.
1. The goal of my codes is to make a new triangle mesh. The new mesh has fewer vertices(TR.Points) than the original one, after I deleted some vertex of it. The index of the faces (TR.ConnectivityList) should be "retrench", that is, the range of the faces (TR.ConnectivityList) will be smaller. See the example below, which is from matlab page,triangulation
% the original mesh
P = [ 2.5 8.0
6.5 8.0
2.5 5.0
6.5 5.0
1.0 6.5
8.0 6.5];
T = [5 3 1;
3 2 1;
3 4 2;
4 6 2];
TR = triangulation(T,P)
triplot(TR)
Now I delete the 5th vertex. The new mesh should be,
T_new = [ 3 2 1;
3 4 2;
4 6 2];
TR1a = triangulation(T_new,P);% some vertices is not referenced
TR1b = simpleTR(TR1a); % the content is above
%>> TR1b.Points
ans =
2.5 8
6.5 8
2.5 5
6.5 5
8 6.5
%>> TR1b.ConnectivityList
ans =
3 2 1
3 4 2
4 5 2
In the process, I need to replace "6" with "5" with changem. In practise, I have to changem many number for a large mesh.
2. For the problem of changem. In this function, I found it did a loop for "find" and "change value" combination.
B(A == oldval(k)) = newval(k);
I believe it has some chance to improve. Because it seems in every loop, it traverses through all of the elements in the matrix(TR.ConnectivityList). I think this way may be imperfect. It may use some hashtable-like thing to do it., which could be done in one loop.
All of this is my guess. Thank you for any suggestions. I am doing some substitutions of the index of triangle mesh. After removing or selecting some points on the mesh, I need to "retrench" the connectivitylist. I always using changem to achieve this. Like below,
function TR1 = simpleTR(TR)
node_idx = unique(TR.ConnectivityList);
node1 = TR.Points(node_idx,:);
node_idx1 = 1:size(node1,1);
face1 = changem(TR.ConnectivityList,node_idx1′,node_idx);
TR1 = triangulation(face1,node1);
end
I found the speed of this is slow when the input TR is big. In profiling, the code in changem below takes the most of time.
B(A == oldval(k)) = newval(k);
Is there any way to accelerate this?
———————-edit for @Cam Salzberger comment———————————————
I would like to clarify my problem in two aspects. One is the bigger picture, which is what I would like to do with the codes. The other is the problem of changem.
1. The goal of my codes is to make a new triangle mesh. The new mesh has fewer vertices(TR.Points) than the original one, after I deleted some vertex of it. The index of the faces (TR.ConnectivityList) should be "retrench", that is, the range of the faces (TR.ConnectivityList) will be smaller. See the example below, which is from matlab page,triangulation
% the original mesh
P = [ 2.5 8.0
6.5 8.0
2.5 5.0
6.5 5.0
1.0 6.5
8.0 6.5];
T = [5 3 1;
3 2 1;
3 4 2;
4 6 2];
TR = triangulation(T,P)
triplot(TR)
Now I delete the 5th vertex. The new mesh should be,
T_new = [ 3 2 1;
3 4 2;
4 6 2];
TR1a = triangulation(T_new,P);% some vertices is not referenced
TR1b = simpleTR(TR1a); % the content is above
%>> TR1b.Points
ans =
2.5 8
6.5 8
2.5 5
6.5 5
8 6.5
%>> TR1b.ConnectivityList
ans =
3 2 1
3 4 2
4 5 2
In the process, I need to replace "6" with "5" with changem. In practise, I have to changem many number for a large mesh.
2. For the problem of changem. In this function, I found it did a loop for "find" and "change value" combination.
B(A == oldval(k)) = newval(k);
I believe it has some chance to improve. Because it seems in every loop, it traverses through all of the elements in the matrix(TR.ConnectivityList). I think this way may be imperfect. It may use some hashtable-like thing to do it., which could be done in one loop.
All of this is my guess. Thank you for any suggestions. speed, changem, index MATLAB Answers — New Questions
save (e.g. gif) a rotation of a 3D geometry around to an axis
I would like to rotate the 3D geometry of a cube around two known nodes.
How can I modify the code?
% ======== CUBE
xc=1; yc=1; zc=1; % coordinated of the center
L=10; % cube size (length of an edge)
alpha=0.8; % transparency (max=1=opaque)
X = [0 0 0 0 0 1; 1 0 1 1 1 1; 1 0 1 1 1 1; 0 0 0 0 0 1];
Y = [0 0 0 0 1 0; 0 1 0 0 1 1; 0 1 1 1 1 1; 0 0 1 1 1 0];
Z = [0 0 1 0 0 0; 0 0 1 0 0 0; 1 1 1 0 1 1; 1 1 1 0 1 1];
C=’blue’; % unicolor
X = L*(X-0.5) + xc;
Y = L*(Y-0.5) + yc;
Z = L*(Z-0.5) + zc;
fill3(X,Y,Z,C,’FaceAlpha’,alpha); % draw cube
axis equal
% ======== NODES x ROTATION
axes_2_nodes = [-4,-4,6; -4,-4,-4];
% ======== ROTATION
set(gcf, ‘Color’, [1 1 1])
set(gca, ‘Visible’, ‘off’);
for i=1:5:300
view(i,33)
pause(0.15)
endI would like to rotate the 3D geometry of a cube around two known nodes.
How can I modify the code?
% ======== CUBE
xc=1; yc=1; zc=1; % coordinated of the center
L=10; % cube size (length of an edge)
alpha=0.8; % transparency (max=1=opaque)
X = [0 0 0 0 0 1; 1 0 1 1 1 1; 1 0 1 1 1 1; 0 0 0 0 0 1];
Y = [0 0 0 0 1 0; 0 1 0 0 1 1; 0 1 1 1 1 1; 0 0 1 1 1 0];
Z = [0 0 1 0 0 0; 0 0 1 0 0 0; 1 1 1 0 1 1; 1 1 1 0 1 1];
C=’blue’; % unicolor
X = L*(X-0.5) + xc;
Y = L*(Y-0.5) + yc;
Z = L*(Z-0.5) + zc;
fill3(X,Y,Z,C,’FaceAlpha’,alpha); % draw cube
axis equal
% ======== NODES x ROTATION
axes_2_nodes = [-4,-4,6; -4,-4,-4];
% ======== ROTATION
set(gcf, ‘Color’, [1 1 1])
set(gca, ‘Visible’, ‘off’);
for i=1:5:300
view(i,33)
pause(0.15)
end I would like to rotate the 3D geometry of a cube around two known nodes.
How can I modify the code?
% ======== CUBE
xc=1; yc=1; zc=1; % coordinated of the center
L=10; % cube size (length of an edge)
alpha=0.8; % transparency (max=1=opaque)
X = [0 0 0 0 0 1; 1 0 1 1 1 1; 1 0 1 1 1 1; 0 0 0 0 0 1];
Y = [0 0 0 0 1 0; 0 1 0 0 1 1; 0 1 1 1 1 1; 0 0 1 1 1 0];
Z = [0 0 1 0 0 0; 0 0 1 0 0 0; 1 1 1 0 1 1; 1 1 1 0 1 1];
C=’blue’; % unicolor
X = L*(X-0.5) + xc;
Y = L*(Y-0.5) + yc;
Z = L*(Z-0.5) + zc;
fill3(X,Y,Z,C,’FaceAlpha’,alpha); % draw cube
axis equal
% ======== NODES x ROTATION
axes_2_nodes = [-4,-4,6; -4,-4,-4];
% ======== ROTATION
set(gcf, ‘Color’, [1 1 1])
set(gca, ‘Visible’, ‘off’);
for i=1:5:300
view(i,33)
pause(0.15)
end rotation, 3d, 3d plots MATLAB Answers — New Questions
Error installing Arduino Add on to MATLAB 2019b
Hey,
I am trying to install Arduino add on to MATLAB 2019b. But I am getting following error ‘The serial interface is not supported on board Due/UNO’. I tried the same with Arduino DUW and Arduino UNO as well. How can I correct this error.
Attached is the screenshot of the error window.Hey,
I am trying to install Arduino add on to MATLAB 2019b. But I am getting following error ‘The serial interface is not supported on board Due/UNO’. I tried the same with Arduino DUW and Arduino UNO as well. How can I correct this error.
Attached is the screenshot of the error window. Hey,
I am trying to install Arduino add on to MATLAB 2019b. But I am getting following error ‘The serial interface is not supported on board Due/UNO’. I tried the same with Arduino DUW and Arduino UNO as well. How can I correct this error.
Attached is the screenshot of the error window. matlab 2019b, arduino uno MATLAB Answers — New Questions
Hidden Size in autoencoder
Hi everyone,
I am looking for a formula to determine the maximum allowable hidden size in an Autoencoder. I came across the following heuristic:
hiddenSize=round(n×numFeatures)
However, I haven’t been able to find a specific reference to cite for this formula.
I would appreciate any guidance or references that could help me adjust the hidden size in an Autoencoder effectively.
Thanks in advance for your assistance.Hi everyone,
I am looking for a formula to determine the maximum allowable hidden size in an Autoencoder. I came across the following heuristic:
hiddenSize=round(n×numFeatures)
However, I haven’t been able to find a specific reference to cite for this formula.
I would appreciate any guidance or references that could help me adjust the hidden size in an Autoencoder effectively.
Thanks in advance for your assistance. Hi everyone,
I am looking for a formula to determine the maximum allowable hidden size in an Autoencoder. I came across the following heuristic:
hiddenSize=round(n×numFeatures)
However, I haven’t been able to find a specific reference to cite for this formula.
I would appreciate any guidance or references that could help me adjust the hidden size in an Autoencoder effectively.
Thanks in advance for your assistance. autoencoder MATLAB Answers — New Questions
How to find RMS bandwidth of the below signal
L=10;
n=1.45;
c=2.9979e8;
dt=6e-12;
T=10*2*L*n/c;
fmax =2.5e9
%fs=80*fmax;
TA=-T/2:dt:T/2;
fs=1/dt;
%t = (-T/2/dt:1:T/2/dt)*dt;
Nt=round(T/dt);
vsine = 1;
phi = vsine*sin(2*pi*fmax*TA);
EL1t=1.274e7*exp(1i*phi);
%plot(TA,(EL1t));
%FA = ((0:Nt-1)-floor(Nt/2))/Nt*fs;
FA = (-Nt/2:Nt/2-1)/Nt*fs;
FP=fft(phi);
%fs=1/dt/Nt;
Z=plot(FA,fftshift(abs(fft(EL1t/Nt))));
I want to find the RMS linewidth of the above signal and the formula for it is given here , but I am confused how to implement it in the code.L=10;
n=1.45;
c=2.9979e8;
dt=6e-12;
T=10*2*L*n/c;
fmax =2.5e9
%fs=80*fmax;
TA=-T/2:dt:T/2;
fs=1/dt;
%t = (-T/2/dt:1:T/2/dt)*dt;
Nt=round(T/dt);
vsine = 1;
phi = vsine*sin(2*pi*fmax*TA);
EL1t=1.274e7*exp(1i*phi);
%plot(TA,(EL1t));
%FA = ((0:Nt-1)-floor(Nt/2))/Nt*fs;
FA = (-Nt/2:Nt/2-1)/Nt*fs;
FP=fft(phi);
%fs=1/dt/Nt;
Z=plot(FA,fftshift(abs(fft(EL1t/Nt))));
I want to find the RMS linewidth of the above signal and the formula for it is given here , but I am confused how to implement it in the code. L=10;
n=1.45;
c=2.9979e8;
dt=6e-12;
T=10*2*L*n/c;
fmax =2.5e9
%fs=80*fmax;
TA=-T/2:dt:T/2;
fs=1/dt;
%t = (-T/2/dt:1:T/2/dt)*dt;
Nt=round(T/dt);
vsine = 1;
phi = vsine*sin(2*pi*fmax*TA);
EL1t=1.274e7*exp(1i*phi);
%plot(TA,(EL1t));
%FA = ((0:Nt-1)-floor(Nt/2))/Nt*fs;
FA = (-Nt/2:Nt/2-1)/Nt*fs;
FP=fft(phi);
%fs=1/dt/Nt;
Z=plot(FA,fftshift(abs(fft(EL1t/Nt))));
I want to find the RMS linewidth of the above signal and the formula for it is given here , but I am confused how to implement it in the code. rms, fft, linewidth, plot, numerical MATLAB Answers — New Questions
Computing Partial derivates of anonymous functions comprised of sum of standard functions
Hi there,
I am implementing a conjugate gradient based optimisation algorithm, and to achieve this i need to calculate the grad of the input function. I currently pass in an anonymous function, which is comprised as the sum of other anonymous functions, of which those are comprised of standard matlab functions. Here is how the objective function is defined
% one constraint for example – all 6 are similar form
c2 = @(x) mat.minSF_yield – mat.yield …
/ axial_stress(mat.F, mat.E, x(1), x(2));
transf_obj = @(x) obj(x) – r * (1 / (c1(x) + c2(x) + c3(x) + c4(x) + c5(x) + c6(x)));
the partial derivative function calculates the partial derivative anon functions and adds them into a cell. This allows the partials to be calculated before the optimisation loop saving computation time
function [grad_cell] = partials(func, x)
% Get dimensionality of inputs
n = numel(x);
% Convert the anonymous function to a symbolic expression
syms a [1 n]
funcSym = func(a);
% Initialize the array to hold partial derivative functions
grad_vect = zeros(1, n);
grad_cell = cell(1,n);
% Compute partial derivatives
for i = 1:n
% Compute symbolic partial derivative with respect to the i-th variable
partialDerivSym = diff(funcSym, a(i));
% Convert symbolic partial derivative back to an anon function
grad = matlabFunction(partialDerivSym, ‘Vars’, {a});
% Add anon function to cell
grad_cell{i} = grad;
end
end
To evalute the gradient at a specific point the following function is used
function [nabla] = compute_grad(cell, x)
nabla = zeros(1,numel(x))
for i =1:numel(x)
nabla(i) = cell{i}(x);
end
end
When evaluting any partial, for some values such as x = [14,3] something within the feasable domain, an empty array is returned. And for values such as x=[7.9,7], a value close to the results i was getting from using fmincon an error of the following is produced.
Error using diff
Difference order N must be a positive integer scalar.
Error in sym/matlabFunction>@(in1)(in1(:,1).*pi.*(3.0./2.5e+…
My current theory is that the conversion to and from symbolic variables to compute the derivative is not being achieved successfuly given the combination of anon functions and locally defined functions. I have tested the partials function with simple functions directly defined and it appears to work. This program is split across 3 files, the first which defines variables and calls the conj-grad m-file. This file then calls the partials.m file which is just the partials function.
%% Variable Definition …
…
%% Call ‘Conj_grad.m’
%% Call ‘partials.m’
%% Returns cell
%% compute at specific point, indexing from cell using compute_grad function
%% Error
Any help is much appreciated.Hi there,
I am implementing a conjugate gradient based optimisation algorithm, and to achieve this i need to calculate the grad of the input function. I currently pass in an anonymous function, which is comprised as the sum of other anonymous functions, of which those are comprised of standard matlab functions. Here is how the objective function is defined
% one constraint for example – all 6 are similar form
c2 = @(x) mat.minSF_yield – mat.yield …
/ axial_stress(mat.F, mat.E, x(1), x(2));
transf_obj = @(x) obj(x) – r * (1 / (c1(x) + c2(x) + c3(x) + c4(x) + c5(x) + c6(x)));
the partial derivative function calculates the partial derivative anon functions and adds them into a cell. This allows the partials to be calculated before the optimisation loop saving computation time
function [grad_cell] = partials(func, x)
% Get dimensionality of inputs
n = numel(x);
% Convert the anonymous function to a symbolic expression
syms a [1 n]
funcSym = func(a);
% Initialize the array to hold partial derivative functions
grad_vect = zeros(1, n);
grad_cell = cell(1,n);
% Compute partial derivatives
for i = 1:n
% Compute symbolic partial derivative with respect to the i-th variable
partialDerivSym = diff(funcSym, a(i));
% Convert symbolic partial derivative back to an anon function
grad = matlabFunction(partialDerivSym, ‘Vars’, {a});
% Add anon function to cell
grad_cell{i} = grad;
end
end
To evalute the gradient at a specific point the following function is used
function [nabla] = compute_grad(cell, x)
nabla = zeros(1,numel(x))
for i =1:numel(x)
nabla(i) = cell{i}(x);
end
end
When evaluting any partial, for some values such as x = [14,3] something within the feasable domain, an empty array is returned. And for values such as x=[7.9,7], a value close to the results i was getting from using fmincon an error of the following is produced.
Error using diff
Difference order N must be a positive integer scalar.
Error in sym/matlabFunction>@(in1)(in1(:,1).*pi.*(3.0./2.5e+…
My current theory is that the conversion to and from symbolic variables to compute the derivative is not being achieved successfuly given the combination of anon functions and locally defined functions. I have tested the partials function with simple functions directly defined and it appears to work. This program is split across 3 files, the first which defines variables and calls the conj-grad m-file. This file then calls the partials.m file which is just the partials function.
%% Variable Definition …
…
%% Call ‘Conj_grad.m’
%% Call ‘partials.m’
%% Returns cell
%% compute at specific point, indexing from cell using compute_grad function
%% Error
Any help is much appreciated. Hi there,
I am implementing a conjugate gradient based optimisation algorithm, and to achieve this i need to calculate the grad of the input function. I currently pass in an anonymous function, which is comprised as the sum of other anonymous functions, of which those are comprised of standard matlab functions. Here is how the objective function is defined
% one constraint for example – all 6 are similar form
c2 = @(x) mat.minSF_yield – mat.yield …
/ axial_stress(mat.F, mat.E, x(1), x(2));
transf_obj = @(x) obj(x) – r * (1 / (c1(x) + c2(x) + c3(x) + c4(x) + c5(x) + c6(x)));
the partial derivative function calculates the partial derivative anon functions and adds them into a cell. This allows the partials to be calculated before the optimisation loop saving computation time
function [grad_cell] = partials(func, x)
% Get dimensionality of inputs
n = numel(x);
% Convert the anonymous function to a symbolic expression
syms a [1 n]
funcSym = func(a);
% Initialize the array to hold partial derivative functions
grad_vect = zeros(1, n);
grad_cell = cell(1,n);
% Compute partial derivatives
for i = 1:n
% Compute symbolic partial derivative with respect to the i-th variable
partialDerivSym = diff(funcSym, a(i));
% Convert symbolic partial derivative back to an anon function
grad = matlabFunction(partialDerivSym, ‘Vars’, {a});
% Add anon function to cell
grad_cell{i} = grad;
end
end
To evalute the gradient at a specific point the following function is used
function [nabla] = compute_grad(cell, x)
nabla = zeros(1,numel(x))
for i =1:numel(x)
nabla(i) = cell{i}(x);
end
end
When evaluting any partial, for some values such as x = [14,3] something within the feasable domain, an empty array is returned. And for values such as x=[7.9,7], a value close to the results i was getting from using fmincon an error of the following is produced.
Error using diff
Difference order N must be a positive integer scalar.
Error in sym/matlabFunction>@(in1)(in1(:,1).*pi.*(3.0./2.5e+…
My current theory is that the conversion to and from symbolic variables to compute the derivative is not being achieved successfuly given the combination of anon functions and locally defined functions. I have tested the partials function with simple functions directly defined and it appears to work. This program is split across 3 files, the first which defines variables and calls the conj-grad m-file. This file then calls the partials.m file which is just the partials function.
%% Variable Definition …
…
%% Call ‘Conj_grad.m’
%% Call ‘partials.m’
%% Returns cell
%% compute at specific point, indexing from cell using compute_grad function
%% Error
Any help is much appreciated. anonymous functions, partial derivatives MATLAB Answers — New Questions
How to convert a .mat file into a .csv file?
Hello Friends,
I have a .mat file loaded in workspace. I want to convert it into .csv file. It has real entries. I used to convert it before using the following commands without any problem:
M = dlmread(‘FileName.mat’, ‘t’, 1, 0);
csvwrite(‘FileName.csv’, M)
But now something is wrong with MATLAB. My dataset is the same. Nothing has changed, but now it gives the following error:
Error using dlmread (line 139)
Mismatch between file and format string.
Trouble reading number from file (row 1u, field 1u) ==>
}Ûa�&Ír!ÃþxbSo�Èñæo8k:¬i’³*Y#�~!I�jË9B¯Ý�WG~
¬zN=å0ÉÀo8Ó’Rå@õR[iãY>,xÊ8UrVÀ9ó";~~�ÀOWAe$�Æ:xfnFVAÿñ�ϼÓЪÍða�þn
I wonder if MATLAB changed something with dlmwrite function! Please advise.Hello Friends,
I have a .mat file loaded in workspace. I want to convert it into .csv file. It has real entries. I used to convert it before using the following commands without any problem:
M = dlmread(‘FileName.mat’, ‘t’, 1, 0);
csvwrite(‘FileName.csv’, M)
But now something is wrong with MATLAB. My dataset is the same. Nothing has changed, but now it gives the following error:
Error using dlmread (line 139)
Mismatch between file and format string.
Trouble reading number from file (row 1u, field 1u) ==>
}Ûa�&Ír!ÃþxbSo�Èñæo8k:¬i’³*Y#�~!I�jË9B¯Ý�WG~
¬zN=å0ÉÀo8Ó’Rå@õR[iãY>,xÊ8UrVÀ9ó";~~�ÀOWAe$�Æ:xfnFVAÿñ�ϼÓЪÍða�þn
I wonder if MATLAB changed something with dlmwrite function! Please advise. Hello Friends,
I have a .mat file loaded in workspace. I want to convert it into .csv file. It has real entries. I used to convert it before using the following commands without any problem:
M = dlmread(‘FileName.mat’, ‘t’, 1, 0);
csvwrite(‘FileName.csv’, M)
But now something is wrong with MATLAB. My dataset is the same. Nothing has changed, but now it gives the following error:
Error using dlmread (line 139)
Mismatch between file and format string.
Trouble reading number from file (row 1u, field 1u) ==>
}Ûa�&Ír!ÃþxbSo�Èñæo8k:¬i’³*Y#�~!I�jË9B¯Ý�WG~
¬zN=å0ÉÀo8Ó’Rå@õR[iãY>,xÊ8UrVÀ9ó";~~�ÀOWAe$�Æ:xfnFVAÿñ�ϼÓЪÍða�þn
I wonder if MATLAB changed something with dlmwrite function! Please advise. dlmwrite, csvwrite, csvread, mat, csv, .mat, .csv, .dat, convert from .mat to .csv, error MATLAB Answers — New Questions
How to transfer color and texture of an image to another image?
I have two RGB images. One is input image and other one is target image. Please find attached the image files. I want to transfer the color and texture of the input image to the target image.
Can someone suggest some solution?I have two RGB images. One is input image and other one is target image. Please find attached the image files. I want to transfer the color and texture of the input image to the target image.
Can someone suggest some solution? I have two RGB images. One is input image and other one is target image. Please find attached the image files. I want to transfer the color and texture of the input image to the target image.
Can someone suggest some solution? digital image processing, image processing, color, colormap, matlab MATLAB Answers — New Questions
Index in position 2 exceeds array bounds (must not exceed 175).
Hello,
I am analysing EEG data using a code that was provided to me. This bit of code was working well a year ago, and I am using it now to add new datasets.I don’t understand what has changed that make it throw an error now.
The script below is used to average, plot and display the 93 EEG electrodes accross all trials for all participants. I get the following error:
Index in position 2 exceeds array bounds (must not exceed 175).
Error in butterfly_graph (line 8)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
DATA is stored in a file called DataForCluster_allparticipants.mat. I don’t understand what exactly is the index in position 2 that exceeds array bounds. I apologise if the answer is very obvious.
my scripts can be found here: https://we.tl/t-0ozTcZFgex
DataForCluster_allparticipants.mat that is the file where the DATA variable is stored
The script forLucie_loadDataForCluster.mat is the script generating the DATA file
The script Butterfly_graph is the script in which I have a problem
load(‘DataForCluster_allparticipants.mat’)
cd(‘/Users/dan/Documents/LucieEEG/Analysis/Sorted’) %change this
%d(1,:) is standard
%d(2,:) is deviant
% d(3,:) is MMN
for i = 1:length(DATA)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
data_DEV(:,:,i) = DATA{2,i}.avg(:, 1:350);
data_MMN(:,:,i) = DATA{3,i}.avg(:, 1:350);
endHello,
I am analysing EEG data using a code that was provided to me. This bit of code was working well a year ago, and I am using it now to add new datasets.I don’t understand what has changed that make it throw an error now.
The script below is used to average, plot and display the 93 EEG electrodes accross all trials for all participants. I get the following error:
Index in position 2 exceeds array bounds (must not exceed 175).
Error in butterfly_graph (line 8)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
DATA is stored in a file called DataForCluster_allparticipants.mat. I don’t understand what exactly is the index in position 2 that exceeds array bounds. I apologise if the answer is very obvious.
my scripts can be found here: https://we.tl/t-0ozTcZFgex
DataForCluster_allparticipants.mat that is the file where the DATA variable is stored
The script forLucie_loadDataForCluster.mat is the script generating the DATA file
The script Butterfly_graph is the script in which I have a problem
load(‘DataForCluster_allparticipants.mat’)
cd(‘/Users/dan/Documents/LucieEEG/Analysis/Sorted’) %change this
%d(1,:) is standard
%d(2,:) is deviant
% d(3,:) is MMN
for i = 1:length(DATA)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
data_DEV(:,:,i) = DATA{2,i}.avg(:, 1:350);
data_MMN(:,:,i) = DATA{3,i}.avg(:, 1:350);
end Hello,
I am analysing EEG data using a code that was provided to me. This bit of code was working well a year ago, and I am using it now to add new datasets.I don’t understand what has changed that make it throw an error now.
The script below is used to average, plot and display the 93 EEG electrodes accross all trials for all participants. I get the following error:
Index in position 2 exceeds array bounds (must not exceed 175).
Error in butterfly_graph (line 8)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
DATA is stored in a file called DataForCluster_allparticipants.mat. I don’t understand what exactly is the index in position 2 that exceeds array bounds. I apologise if the answer is very obvious.
my scripts can be found here: https://we.tl/t-0ozTcZFgex
DataForCluster_allparticipants.mat that is the file where the DATA variable is stored
The script forLucie_loadDataForCluster.mat is the script generating the DATA file
The script Butterfly_graph is the script in which I have a problem
load(‘DataForCluster_allparticipants.mat’)
cd(‘/Users/dan/Documents/LucieEEG/Analysis/Sorted’) %change this
%d(1,:) is standard
%d(2,:) is deviant
% d(3,:) is MMN
for i = 1:length(DATA)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
data_DEV(:,:,i) = DATA{2,i}.avg(:, 1:350);
data_MMN(:,:,i) = DATA{3,i}.avg(:, 1:350);
end psychology, eeg, indexing MATLAB Answers — New Questions
merge two stl (or combination of nodes and mesh of two separate 3D geometries) into one geometry
I have two 3D geometries (‘sol_1.stl’ and ‘sol_2.stl’) and their corresponding nodes and faces.
I would like to combine the two STL geometries into a single geometry, or merge the nodes and faces of the two geometries into one.
sol_1.st + sol_2.st -> sol_fin.stl
nodes_sol_1 + nodes_sol_2 -> nodes_sol_fin (simple)
faces_sol_1 + faces_sol_2 -> faces_sol_finI have two 3D geometries (‘sol_1.stl’ and ‘sol_2.stl’) and their corresponding nodes and faces.
I would like to combine the two STL geometries into a single geometry, or merge the nodes and faces of the two geometries into one.
sol_1.st + sol_2.st -> sol_fin.stl
nodes_sol_1 + nodes_sol_2 -> nodes_sol_fin (simple)
faces_sol_1 + faces_sol_2 -> faces_sol_fin I have two 3D geometries (‘sol_1.stl’ and ‘sol_2.stl’) and their corresponding nodes and faces.
I would like to combine the two STL geometries into a single geometry, or merge the nodes and faces of the two geometries into one.
sol_1.st + sol_2.st -> sol_fin.stl
nodes_sol_1 + nodes_sol_2 -> nodes_sol_fin (simple)
faces_sol_1 + faces_sol_2 -> faces_sol_fin stl, merge, union, combination, 3d, 3d plots MATLAB Answers — New Questions