Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Forward port #2789: windows fixes #2985

Merged
merged 4 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gazebo/common/Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ void Material::SetTextureImage(const std::string &_tex,
}
}
}

// normalize the path
this->texImage = boost::filesystem::path(this->texImage)
.make_preferred().string();
}

//////////////////////////////////////////////////
Expand Down
20 changes: 15 additions & 5 deletions gazebo/common/ModelDatabase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -503,19 +503,29 @@ std::string ModelDatabase::GetModelPath(const std::string &_uri,
continue;
}

std::string outputPath = getenv("HOME");
outputPath += "/.gazebo/models";

#ifndef _WIN32
TAR *tar;
tar_open(&tar, const_cast<char*>(tarfilename.c_str()),
nullptr, O_RDONLY, 0644, TAR_GNU);

std::string outputPath = getenv("HOME");
outputPath += "/.gazebo/models";

tar_extract_all(tar, const_cast<char*>(outputPath.c_str()));
#else
// Tar now is a built-in tool since Windows 10 build 17063.
std::string cmdline = "tar xzf \"";
cmdline += tarfilename + "\" -C \"";
cmdline += outputPath + "\"";
auto ret = system(cmdline.c_str());
if (ret != 0)
{
gzerr << "tar extract ret = " << ret << ", cmdline = " << cmdline
<< std::endl;
}
#endif
path = outputPath + "/" + modelName;

ModelDatabase::DownloadDependencies(path);
#endif
}

curl_easy_cleanup(curl);
Expand Down
2 changes: 1 addition & 1 deletion gazebo/sensors/GaussianNoiseModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ double GaussianNoiseModel::GetBias() const
//////////////////////////////////////////////////
void GaussianNoiseModel::SampleBias()
{
if(this->biasStdDev)
if(!math::equal(0.0, this->biasStdDev))
{
this->bias =
ignition::math::Rand::DblNormal(this->biasMean, this->biasStdDev);
Expand Down