Skip to content

Commit

Permalink
Adapted RobotModels to use the unit scaling factor for compatibility …
Browse files Browse the repository at this point in the history
…with Gazebo's interpretation of Collada files
  • Loading branch information
jon-weisz committed Mar 5, 2013
1 parent e4711c5 commit cf398f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/rviz/robot/robot_link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,18 @@ void RobotLink::createEntityForGeometryElement(const urdf::LinkConstPtr& link, c
if ( mesh.filename.empty() )
return;

scale = Ogre::Vector3(mesh.scale.x, mesh.scale.y, mesh.scale.z);



scale = Ogre::Vector3(mesh.scale.x, mesh.scale.y, mesh.scale.z);

std::string model_name = mesh.filename;
loadMeshFromResource(model_name);

//! Read unit rescaling factor from file because ASSIMP doesn't do it.
float unit_scale = getMeshUnitRescale(model_name);
scale *= unit_scale;

try
{
entity = scene_manager_->createEntity( ss.str(), model_name );
Expand Down

0 comments on commit cf398f5

Please sign in to comment.