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

New VisualStates_py tool #902

Merged
merged 61 commits into from Oct 9, 2017
Merged

Conversation

okanasik
Copy link
Contributor

New VisualStates_py tool that is developed using PyQt5 and python2. The tool has two python dependencies python-sysv-ipc (ubuntu package) and python-pyqt5-qsci (ubuntu package). The tool has following improvements compared to previous version:

  • ROS integration by using JdeRobot communication framework
  • Refactoring using python and PyQt5
  • New object-oriented C++ and Python state machine templates
  • Unified runtime gui
  • QScintilla code editor integration for syntax highlighting

The following videos demos the features of the new tool:

The latest state of the tool and new c++ and python state machine templates can be seen in the following videos:

…by new, we can save simple states and transitions as xml file
… from actual model state and transition model
@okanasik
Copy link
Contributor Author

I have merged master. Can we postpone this pull request until I finish ROS Node generation because I work on this pyqt_refactoring branch and this pull request have some of my incomplete commits. Although, it does not break anything, there will be unused codes.

@fqez
Copy link
Member

fqez commented Sep 24, 2017

Hi @okanasik
could you also modify your root CMakeLists including "COMPONENT visualStates" in each cmake install directive? If there's already a "COMPONENT tools" overwrite it.
For instance:

INSTALL(TARGETS visualStatesRunTime DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/visualstates_py/)

becomes:

INSTALL(TARGETS visualStatesRunTime DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/visualstates_py/ COMPONENT visualStates)

Thanks a lot an really good job :D

@aitormf
Copy link
Collaborator

aitormf commented Oct 5, 2017

Hi, @okanasik good job!!!

Can you update update your tool with the new version of JdeRobotComm(Comm) and config library ( #916 )?
you have examples in basic_component_py sample and cameraview tool

regards, Aitor

@okanasik
Copy link
Contributor Author

okanasik commented Oct 8, 2017

Dear @aitormf and @jmplaza,

I think the tool is ready for the merge, but i did not test with install by deb package. Is there anything that I need to check?

@aitormf
Copy link
Collaborator

aitormf commented Oct 9, 2017

Hi @okanasik, good job.

don't worry, I make those changes

@aitormf
Copy link
Collaborator

aitormf commented Oct 9, 2017

@okanasik, when I'm using visualStates_py to generate cpp code, I get the followinng error (with python all OK):

Traceback (most recent call last):
  File "/home/kasillas77/git/test/okan/src/tools/visualStates_py/gui/visualstates.py", line 286, in generateCppAction
    generator.generate(self.fileManager.getPath(), self.fileManager.getFileName())
  File "/home/kasillas77/git/test/okan/src/tools/visualStates_py/gui/cppgenerator.py", line 68, in generate
    self.generateHeaders(stringList, projectName)
  File "/home/kasillas77/git/test/okan/src/tools/visualStates_py/gui/cppgenerator.py", line 136, in generateHeaders
    headers.append(self.interfaceHeaders[cfg['proxyName']].strip('\n'))
KeyError: u'pose3d'

This is the XML file

<?xml version="1.0" ?>
<VisualStates>
  <config type="0">
    <interfaces>
      <interface>
        <serverType>ice</serverType>
        <name>pose3d</name>
        <topic></topic>
        <proxyName>pose3d</proxyName>
        <ip>0.0.0.0</ip>
        <port>2345</port>
        <interfaceName>Pose3d</interfaceName>
      </interface>
    </interfaces>
  </config>
  <libraries/>
  <state id="0" initial="True">
    <posx>0.0</posx>
    <posy>0.0</posy>
    <name>root</name>
    <code></code>
    <functions></functions>
    <timestep>100</timestep>
    <state id="1" initial="True">
      <posx>879.0</posx>
      <posy>874.0</posy>
      <name>state 1</name>
      <code>std::cout &lt;&lt; &quot;hola&quot;;</code>
      <functions></functions>
      <timestep>100</timestep>
      <transition id="1">
        <type>0</type>
        <time>5000</time>
        <posx>971.0</posx>
        <posy>915.5</posy>
        <name>transition 1</name>
        <originid>1</originid>
        <destinationid>2</destinationid>
        <code></code>
      </transition>
    </state>
    <state id="2" initial="False">
      <posx>1063.0</posx>
      <posy>957.0</posy>
      <name>state 2</name>
      <code>std::cout &lt;&lt; &quot;adios&quot;;</code>
      <functions></functions>
      <timestep>100</timestep>
    </state>
  </state>
</VisualStates>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants