Skip to content

Commit

Permalink
Potential CI server #26 issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
divbugger committed Nov 16, 2023
1 parent 960ffb1 commit 317995d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 26 deletions.
14 changes: 7 additions & 7 deletions haros_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,24 @@ haros init

echo ""
echo "## Call the HAROS plugin to extract the ros-models ##"
if [ -n $ROS_PYTHON_VERSION ]
if [ -n $PYTHON_VERSION ]
then
if [[ $ROS_PYTHON_VERSION == "2" ]]
if [[ $PYTHON_VERSION == "2" ]]
then
if [ "${2}" = "--all" ]
then
python /home/divya/Documents/Master_Thesis/ros_model_extractot_fork/ros-model-extractors/ros_model_extractor.py --package "$1" --"${3}" --model-path "${4}" --ws "${5}" --repo $model_repo -a>> extractor.log
python /ros_model_extractor.py --package "$1" --"${3}" --model-path "${4}" --ws "${5}" --repo $model_repo -a>> extractor.log
else
python /home/divya/Documents/Master_Thesis/ros_model_extractot_fork/ros-model-extractors/ros_model_extractor.py --package "$1" --name "$2" --"${3}" --model-path "${4}" --ws "${5}" --repo $model_repo>> extractor.log
python /ros_model_extractor.py --package "$1" --name "$2" --"${3}" --model-path "${4}" --ws "${5}" --repo $model_repo>> extractor.log
fi
#cat extractor.log
elif [[ $ROS_PYTHON_VERSION == "3" ]]
elif [[ $PYTHON_VERSION == "3" ]]
then
if [ "${2}" = "--all" ]
then
python3 /home/divya/Documents/Master_Thesis/ros_model_extractot_fork/ros-model-extractors/ros_model_extractor.py --package "$1" --"${3}" --model-path "${4}" --ws "${5}" --path-to-src "$path_to_src_code" --repo $model_repo -a >> ${4}/extractor.log
python3 /ros_model_extractor.py --package "$1" --"${3}" --model-path "${4}" --ws "${5}" --path-to-src "$path_to_src_code" --repo $model_repo -a >> ${4}/extractor.log
else
python3 /home/divya/Documents/Master_Thesis/ros_model_extractot_fork/ros-model-extractors/ros_model_extractor.py --package "$1" --name "$2" --"${3}" --model-path "${4}" --ws "${5}" --path-to-src "$path_to_src_code" --repo $model_repo>> ${4}/extractor.log
python3 /ros_model_extractor.py --package "$1" --name "$2" --"${3}" --model-path "${4}" --ws "${5}" --path-to-src "$path_to_src_code" --repo $model_repo>> ${4}/extractor.log
fi
#cat extractor.log
else
Expand Down
16 changes: 1 addition & 15 deletions rosHumble_model_extractor_scripts/Ros_Extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,28 +313,16 @@ def extract_primitives(self, node, parser, analysis, RosModel_node, roscomponent
#ROS2
if node.language == "cpp":
for call in (CodeQuery(gs).all_calls.get()):
print("-------------------")

printDict = {"full_name":call.full_name,
"canonical_type": call.canonical_type,
"call_variable": str(call),
"line_no":call.line,
"name":call.name,
"column":call.column,
"file_name": call.file}


if "Publisher" in str(call):
print("Printing calll========================", call)
if len(call.arguments) > 1:
name = analysis._extract_topic(call, topic_pos=0)
msg_type = analysis._extract_message_type(call)
queue_size = analysis._extract_queue_size(call, queue_pos=1)
if name!="?" or msg_type!="?":
RosModel_node.add_publisher(name, msg_type.replace("/",".").replace(".msg",""))

if "Subscription" in str(call):
#print(call)
if "Subscriber" in str(call):
if len(call.arguments) > 1:
name = analysis._extract_topic(call, topic_pos=0)
msg_type = analysis._extract_message_type(call)
Expand All @@ -343,8 +331,6 @@ def extract_primitives(self, node, parser, analysis, RosModel_node, roscomponent
RosModel_node.add_subscriber(name, msg_type.replace("/",".").replace(".msg",""))

if "Service" in str(call) or "::srv::" in str(call.function):
print(call.function.canonical_type)
print(printDict)
if len(call.arguments) > 1:
name = analysis._extract_topic(call, topic_pos=0)
srv_type = analysis._extract_message_type(call)
Expand Down
2 changes: 1 addition & 1 deletion rosHumble_model_extractor_scripts/ros2runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self,
outputDir=outputDir)

def runColconBuild(self,):
subprocess.run(["colcon", "build", "--cmake-args", "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"])
subprocess.run(["colcon", "build", "--cmake-args"]) #CMake Colcon Warning fix

def runColconList(self,):
os.system('colcon list > /tmp/colcon_list.txt')
Expand Down
2 changes: 1 addition & 1 deletion rosHumble_model_extractor_scripts/ros_pkg_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def cleanUPsrc(self):

def callHarosPlugin(self,):

print("Update code to execute harosPlugig command!!")
print("Update code to execute harosPlugin command!!")

def mkOuputDir(self,):

Expand Down
4 changes: 2 additions & 2 deletions ros_model_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def launch(self):

#BONSAI PARSER
parser = CppAstParser(workspace = ws)
parser.set_library_path("/usr/lib/llvm-14/lib")
parser.set_standard_includes("/usr/lib/llvm-14/lib/clang/14.0.0/include")
parser.set_library_path("/usr/lib/llvm-10/lib")
parser.set_standard_includes("/usr/lib/llvm-14/lib/clang/10.0.0/include")
db_dir = os.path.join(ws, "build")
if os.path.isfile(os.path.join(db_dir, "compile_commands.json")):
parser.set_database(db_dir)
Expand Down

0 comments on commit 317995d

Please sign in to comment.