<commit_before>#!/bin/bash

cd ../urdf

echo "Creating bare urdf of coman.urdf.xacro"
rosrun xacro xacro.py coman.urdf.xacro > coman.urdf
echo "...urdf correctly created!"

if [ $# == "ros" ]
  then
    GAZEBO_COMAN_USES_ROS=1
    GAZEBO_COMAN_USES_YARP=0
    echo "Creating urdf of coman_robot.urdf.xacro with ROS plugins"
   else
    GAZEBO_COMAN_USES_ROS=0
    GAZEBO_COMAN_USES_YARP=1
    echo "Creating urdf of coman_robot.urdf.xacro with YARP plugins"
fi
rosrun xacro xacro.py coman_robot.urdf.xacro > coman_robot.urdf
echo "...urdf correctly created!"

echo "Creating sdf of coman_robot.urdf..."
gzsdf print coman_robot.urdf > coman.sdf

if [ $GAZEBO_COMAN_USES_YARP -eq 1 ]
  then
    python ../script/gazebowtf.py coman.gazebo.wtf > coman2.sdf
    mv coman2.sdf coman.sdf
fi

echo "...sdf correctly created!"

echo "Removing coman_robot.urdf."
rm coman_robot.urdf

echo "Copying coman.sdf in coman_gazebo/sdf."
cp coman.sdf ../../coman_gazebo/sdf

echo "Removing coman.sdf"
rm coman.sdf

cd ..

echo "Copying meshes in coman_gazebo/sdf."
cp -r meshes/ ../coman_gazebo/sdf

cd ../coman_gazebo

echo "Copying all data in coman_gazebo/sdf in ~/.gazebo/models/coman_urdf"
mkdir coman_urdf

cd sdf

cp -r * ../coman_urdf

cd ../

cp -r coman_urdf ~/.gazebo/models

rm -rf coman_urdf
echo "Finish! Enjoy COMAN in GAZEBO!"

<commit_msg>Fixed create_urdf_and_sdf to export middleware environment variables after setting them and before running the ros xacro script, and unsetting them after the xacro and gazebowtf scripts terminate.<commit_after>#!/bin/bash

cd ../urdf

echo "Creating bare urdf of coman.urdf.xacro"
rosrun xacro xacro.py coman.urdf.xacro > coman.urdf
echo "...urdf correctly created!"

if [ $# == "ros" ]
  then
    GAZEBO_COMAN_USES_ROS=true
    GAZEBO_COMAN_USES_YARP=false
    echo "Creating urdf of coman_robot.urdf.xacro with ROS plugins"
   else
    GAZEBO_COMAN_USES_ROS=false
    GAZEBO_COMAN_USES_YARP=true
    echo "Creating urdf of coman_robot.urdf.xacro with YARP plugins"
fi

export GAZEBO_COMAN_USES_YARP
export GAZEBO_COMAN_USES_ROS
rosrun xacro xacro.py coman_robot.urdf.xacro > coman_robot.urdf
echo "...urdf correctly created!"

echo "Creating sdf of coman_robot.urdf..."
gzsdf print coman_robot.urdf > coman.sdf

if [ $GAZEBO_COMAN_USES_YARP ]
  then
    python ../script/gazebowtf.py coman.gazebo.wtf > coman2.sdf
    mv coman2.sdf coman.sdf
fi

unset GAZEBO_COMAN_USES_YARP
unset GAZEBO_COMAN_USES_ROS

echo "...sdf correctly created!"

echo "Removing coman_robot.urdf."
#rm coman_robot.urdf

echo "Copying coman.sdf in coman_gazebo/sdf."
cp coman.sdf ../../coman_gazebo/sdf

echo "Removing coman.sdf"
rm coman.sdf

cd ..

echo "Copying meshes in coman_gazebo/sdf."
cp -r meshes/ ../coman_gazebo/sdf

cd ../coman_gazebo

echo "Copying all data in coman_gazebo/sdf in ~/.gazebo/models/coman_urdf"
mkdir coman_urdf

cd sdf

cp -r * ../coman_urdf

cd ../

cp -r coman_urdf ~/.gazebo/models

rm -rf coman_urdf
echo "Finish! Enjoy COMAN in GAZEBO!"


{'fraction_non_alphanumeric': 0.10046885465505694, 'fraction_numerical': 0.003014065639651708, 'mean_word_length': 3.7187993680884674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3299389', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1302, 'n_words': 306}