Raj Patel Notebook - cps-vip/cps-cosimulation-env GitHub Wiki

Week 1

AUGUST

The main team was split into 2 subteams: ROS-HELICS and Device Modelling. Notebook rubrics still to be released and no significant progress on research/coding by subteam. I will keep the notebook updated with progress.

SEPTEMBER

09/22/2023

  1. Finally set up my notebook, couldn't edit the page at first but I realized I was logged in to a different Github account. Adding dates as headers to organize entries by week. This website helped: https://docs.github.com/en/communities/documenting-your-project-with-wikis/adding-or-editing-wiki-pages

  2. When trying to setup nix on my system, I run into an issue:

Nix develop issue

Not sure what the problem is, currently reading through https://github.com/NixOS/nix/issues/3435 for a solution. I suspect that the issue may be about > having performed a [recommended] multi-user install rather than a single-user install.

  1. Edited /etc/nix/nix.conf using Vim and changed the line "experimental-features = nix-command develop flakes" to "experimental-features = nix-command flakes" as per instructor's guidance. Operation not permitted error still persists.

  2. Started working on refreshing Python skills. Watching YouTube videos on some of the basics. There isn't a specific YouTube Channel I am watching, just any related videos that show up in the search.

Week 2

09/29/2023

  1. Performed a clean single-user-install of Nix. Getting a new error now: Single user install error

  2. Was able to fix above error by copy-pasting command from Nix installation website instead of typing it out. However, running into a new error. bash not found error

  3. Conducted research on HELICS framework to understand it better with questions in mind like: "What information do we get from HELICS" and "What information we send to HELICS".

  4. As per instructor feedback, brachiating robots are very complex and would require a lot of resources. Switched attention to other types of inspection robots, and reading articles on UAVs and UGVs to see if we can find a more suitable robot. A good source: https://ieeexplore.ieee.org/document/7956250.

OCTOBER

Week 3

10/02/2023

  1. Started a C++ course on w3schools.com, still brushing up on Python skills as well. Link for C++ tutorials on w3schools: https://www.w3schools.com/cpp/

  2. Caught up with missed team discussion that was held on 09/29/2023 by reading through google document created for team meeting notes.

  3. Preparation for upcoming IPR presentation that is on 10/04/2023. Working on "Progress to Date" slide for ROS/HELICS team. The ROS/HELICS team has a clearer approach in how to proceed with the integration of ROS and HELICS, so that is what I included in the "Progress to Date" slide, detailing decisions made, questions to think about in the future and what research is required to answer these questions.

  4. The team has settled on the idea of a line-inspection robot. While looking into them, I discovered that line-inspection robots have become increasingly prominent in industries such as power distribution, where they are employed to inspect and maintain equipment on power lines and other linear structures. These robots are specifically designed for traversing linear paths efficiently, and their compatibility with the infrastructure in substation environments makes them a practical choice as compared to brachiating robots.

Week 4

10/13/2023

  1. Conducted research on GridLAB-D and HELICS integration, read about federates and federate configuration for the midterm paper.
  2. Still working on the C++ course I started last week. Nearly done brushing up my Python coding.
  3. Looked into an IEEE article that talks about line inspection robots and a focus on its obstacle-detection. Our sub-team has changed the semester focus from a brachiating robot to a line inspection robot. Article link: IEEE Article

Week 5

10/20/2023

  1. Worked on the midterm paper yesterday that was typeset in LaTeX using the IEEE conference template . My sections were about giving a rundown of ROS and discussing renewable sources of energy and how they can be implemented on the line inspection robot.

  2. Had a look at the ROS documentation. YouTube tutorials like these ROS Tutorials for Beginners are also helpful.

  3. Finished my Python review. Still working on C++ coding.

Week 6

10/27/2023

  1. I tried to log in to the ECE linux machines since our team is trying to find a different way to run the GridLAB-d example through a virtual machine, however, I get the following error when I try to perform an installation of Nix. It seems that I cannot use sudo and OIT would need to be contacted to help with this issue.

vip1

  1. Looked through relay_config.json which defines the parameters and requirements for the relay federate in a simulation environment, and relay_simulator.py script which demonstrates the usage of the HELICS library for federate communication and synchronization. These files can be found in the simple_gridlab_d/relay folder.

  2. IPR1 and Paper grades were released to our team leader who then informed us about them. I looked through the feedback to see what I can work on to help the team for IPR2 which is coming up in 2 weeks. The feedback was as follows:

  • IPR1: "The presentations biggest weakness was the intro/opening. The presentation became to technically focused too quickly, and skipped over important background like the overall objectives and how the revised plan meets those objectives. That being said, the students were clearly excited about their new concept so we were happy to see that. The concept clarity was much improved, as was the technical feasibility. The concept clarity should improve with additional class time background research. The team should now focus on micro technical demos to validate the approach and revising the intro before next presentation. The team should seek to make more specific the tangible goals and milestones, with particular emphasis on integration of those tasks. This is particularly true for the ROS/HELICS interface team. A Gantt chart may help with this and/or consider further revising the listed objectives to find and state dependencies in tasks."

  • Midterm Paper: "Overall, the paper was an excellent draft for a group of students at this experience level and part way through the class. The introduction was written at an appropriate level and discovery of sources was also above average. Most students struggle to write the intro as an appropriate level. The biggest lacking element in the draft is graphics, particularly custom block diagrams that assist the reading in quickly assessing what the objective and scope of the research is. In reality, most submissions are probably evaluated as strong/weak-accept/reject by a graduate student in under 30 minutes. Block diagrams (and future data plots/graphs explaining results in future semesters) quickly help the reviewer assess the work. This is particularly true for the “Our Research” section, who weakest element is the lack of a plan for integrating all of the pieces. It’s preferable to show a diagram that changes later upon finding a specific approach isn’t feasible, than to defer until the project takes father shape."

  1. The team is now focusing on research on key areas such as ROS/HELICS, GridLAB-D, and installing a VM. The team has been further subdivided so that members of the team are parallelizing the research progress, with different sub-teams "specializing" in different key areas.

NOVEMBER

Week 7

11/03/2023

  1. I carried out my research on GridLAB-D to better prepare myself for the upcoming subteam meeting where each team member will discuss their research about installing the VM, ROS, HELICS and GridLAB-D. In doing so, I learned about nodes, lines and recorders.

  2. Met up with my subteam on 10/31/2023 to discuss my findings on GridLAB-D, as well as research done by other members of the team on ROS and HELICS. I talked about what GridLAB-D is, how it is useful for our purpose and how it is integrated with HELICS. In the meeting, we also discussed the structure of a .glm file including modules, classes and objects.

  3. This week, we had in-person paper reviews where each subteam reviews the midterm research paper written by the other subteam. One of the instructors, Will Stuckey, showed us how he went through with the process of reviewing research papers. A few things mentioned by him that stood out to me were: Looking for familiar diagrams for those within the field or its related disciplines, clarity and for the introduction and conclusion to match for either a subsection or the entire paper itself.

  4. TO DO:

  • look at code progress on robot created by team members working on ROS. 🎉
  • Find a way to log into VM (Google Cloud). 🎉

Week 8

11/10/2023

  1. I installed ROS Noetic Ninjemys for Ubuntu 20.04. Read through the tutorials section at ROS Tutorials which have been really helpful in setup and getting started. One thing that was frustrating is every time I start the terminal, I have to set up the environment using the line: "source /opt/ros/noetic/setup.bash"

  2. I was finally able to run the Gridlab-D example. I had to perform a fresh installation, and this time I made sure that it was a single user installation using the flag "--no--daemon". Refer to week 1 entries in my notebook to get more information on the issues I was facing.

  3. First attempt at writing a python script that acts as a subscriber federate in the HELICS framework. Obviously didn't work out but it has definitely helped my understanding of the publisher-subscriber mechanism. I will take a look at YouTube links and documentation linked in earlier notebook entries to see how well I can improve to make it work.

  • upload HELICS error screenshot helics error

Week 9

11/17/2023

Important

At the time of this notebook entry, the team made use of ROS2 Humble.

After discussing with members of the subteam and instructors, the team has decided to go ahead and make the switch from ROS1 to ROS2. I initially worked on the integration of ROS and HELICS using the ROS Noetic distribution which is the latest version of ROS. It helped that ROS Noetic was specifically built and tested for compatibility with Ubuntu 20.04 LTS which is what I was using to make progress on the integration of ROS and HELICs. The reasons for making this switch are as follows:

  • Although ROS1 still gets maintenance updates and bug fixes, it has reached its end-of-life. It would be wise to make the switch to ROS2 early on before we make any major code changes/implementations which mitigates the risk of having to transfer code written for ROS1 to ROS2.
  • ROS1 had more tutorials online which helped with writing code and figuring out how things worked as compared to ROS2, however, we think that ROS2 has a lot more features and new ways of doing things that will definitely get some kind of community tutorials/guides. *ROS1 Lacks inherent real-time capabilities, posing challenges in applications that demand precise timing and responsiveness while ROS2 incorporates Real-Time Publish-Subscribe (RTPS) protocol, allowing for deterministic communication and improved support for real-time systems. *ROS1 is primarily designed for Linux environments, limiting deployment flexibility, while ROS2 offers broader platform support, extending to platforms such as Windows and macOS. We had several issues this semester with members of the team owning a MacBook not being able to run ROS on their system and would have to resort to the use of VMs.
  • ROS2 implements enhanced security measures compared to ROS1 where data integrity and confidentiality were cause for concern.

Warning

You must be running 22.04.3 LTS to be able to install ROS2 and have it run successfully on your system. ROS2 did not work for me when I tried installing it on 20.04.6 LTS

Note

The reasons for the switch from ROS1 to ROS2 are based on instructor feedback and personal research.

I also found out that some standard and important ROS1 packages have not yet been ported to ROS2 which may or may not cause problems in the near future depending on the complexity of the code we develop. If it does cause any issues, we can make use of the ROS 1 Bridge which is a ROS 2 package that provides nodes to bridge topics between ROS 1 and ROS 2. Perhaps I can make use of this to make my example work on ROS 2.

Week 10

11/24/2023

**Thanksgiving break week

DECEMBER

Week 11

12/01/2023

  1. The team got together on Tuesday to discuss how we should best work on the final presentation. Slides were assigned to everyone from the subteam. My slide was to work on "The Big Idea - MVP". MVP means Minimum Viable Product which by definition, and in our case, is a version of our robot with very basic features to enable us to test interactions with substation equipment in a simulated environment. The function of our robot is very simple; it moves in a straight line and we may consider adding a robotic arm for interaction. Furthermore, I was also supposed to talk about the integration of ROS and HELICS (which as you can see from previous weeks' notebook entries) and how we tried to achieve it, why it was necessary. I am still to work on these slides and will update the notebook as I make progress.

  2. image The diagram above shows how we aim to implement the integration of all the different components. Somewhere in there, we will bring Gazebo in too, however, we think that it may be best if we make the use of Gazebo just to test how our robot developed with ROS would function in the real world i.e just simulating behavior. We will explore HELICS co-simulation capabilities to synchronize and coordinate the execution of ROS 2 and GridLAB-D components once we integrate ROS2 and HELICS as Gridlab-D is already able to communicate with HELICS. Gridlab-D is integrated with HELICS as a federate. Then we can pass messages from ROS 2 to HELICS to GridLAB-D (more simply put, I think that it's a message from ROS2 to GridLAB-D but the communication is just being handled by HELICS).

Important

The entry below summarizes most of the research and understanding of the subteam so far. It is crucial to go into writing code and developing robot systems having done proper research. The team has put in a good amount of time to conduct research on the various components but some information may be inaccurate so please conduct your own research to nullify any discrepancies...however, what I have should help form a solid understanding of how these different components integrate and work together.

Why is the integration of HELICS, GridLAB-D and ROS 2 necessary?

  • GridLAB-D: GridLAB-D is primarily used to simulate power distribution systems, including the behavior of electrical loads, transformers, voltage regulators, capacitors, and other distribution components. This would allow us to analyze the performance and interactions of these elements in a simulated environment.
  • HELICS: enables real-time co-simulation, allowing you to model the dynamic behavior of the electrical grid using GridLAB-D.
  • HELICS and GridLAB-D: This realistic simulation environment helps you test and validate robotic systems, such as a line inspection robot, under conditions that closely mimic those of an actual electrical substation.
  • ROS 2: It is a powerful middleware for robotics that facilitates communication and control between different components of a robotic system. Integrating ROS 2 with HELICS allows you to connect your robotic systems to the simulated grid, enabling communication and control in a co-simulation environment.
  • ROS 2 and HELICS: By combining ROS 2 and HELICS, you can develop and test coordinated control strategies for the line inspection robot based on real-time information from the simulated electrical grid. This is essential for ensuring that the robot can adapt to dynamic grid conditions during its inspection tasks.

ros-bridge

Week 12

12/08/2023

  1. This was the last week of school. We had several deliverables including code, the final paper and making sure out notebooks were updated.

  2. For the final paper, I was supposed to write about what the team's progress has been so far with the ROS-HELICS Integration, explain why this integration is necessary with the help of block diagrams. I was also supposed to expand on how GridLAB-D, ROS and HELICS all fit together in the co-simulation environment. The block diagram I designed was about how HELICS works and how some of the pieces fit within it: final (2) The second diagram I included also helps the reader understand how Gazebo and GridLAB-D fit as simulators in the HELICS framework. architecture

  3. I also uploaded my files to Github. Although they don't work as intended, it helped me develop a good understanding of how ROS and HELICS would communicate using the pub-sub communication mechanism. In the code I wrote, the ROS2 node is able to register as a federate in HELICS and it is able to send messages to HELICS but HELICS cannot receive this messages. I will have to continue reading through the documentation for ROS, HELICS and go through the simple-gridlabd-example provided and try emulating code from there to see if I can understand better. Below, I provide clarifications and notes on running my example, which can be found on GitHub at this link

broker 1 broker 2

Warning

If you see these errors, then it means you have to run the broker first, which can be done with the command below. It must be run on a separate terminal.

run broker

Run the scripts on two different terminals, and what you will see is shown below:

ros-helics works kinda

The problem at first was that the HELICS federate that subscribes is not able to go into execution mode. The problem might have to do with time synchronization, or it could be with decoding the received data. I will try to figure out how to send values instead of a string. Furthermore, I should try to create a json file to create the federate from the config file. Please refer to the code to understand my approach. It is still a work in progress but I believe the team and I will get this integration established very soon.

⚠️ **GitHub.com Fallback** ⚠️