Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2201e29
added status structs and status manager
Johnarman1398 Oct 6, 2025
8f54088
updated clang-format
Johnarman1398 Oct 6, 2025
e1fd3f5
resolved conflicts with main
Johnarman1398 Oct 8, 2025
21c15c3
include std::atomic
Johnarman1398 Oct 8, 2025
62af52b
changed executables to normal file
Johnarman1398 Oct 8, 2025
2dc3999
removed CMakeLists.txt exec permission
Johnarman1398 Oct 8, 2025
17fa048
remove exec permission
Johnarman1398 Oct 8, 2025
1a49655
Initial commit
shawnkchan Oct 9, 2025
3bf1a95
fix: fixes wrong return value in is_vehicle_waiting_for_update
shawnkchan Oct 10, 2025
624d909
feat: add unit tests
shawnkchan Oct 11, 2025
6e75a11
feat: add test cases for OrderManager
shawnkchan Oct 13, 2025
899513a
docs: update docstrings
shawnkchan Oct 13, 2025
8875393
refactor: remove update_horizon function in Order class as it is unused
shawnkchan Oct 13, 2025
708bb49
docs: adds docstrings for Order class
shawnkchan Oct 13, 2025
f516378
docs: add more detailed docstrings
shawnkchan Oct 13, 2025
77a67eb
refactor: remove unused function in OrderManager
shawnkchan Oct 13, 2025
0aeade7
refactor: remove unused function is_graph_valid from OrderManager
shawnkchan Oct 13, 2025
325b7eb
style: run linter
shawnkchan Oct 13, 2025
39d9502
style: change docstring marker
shawnkchan Oct 13, 2025
cbc8153
docs: add docstrings detailing expected APIs from stateManager
shawnkchan Oct 13, 2025
a539df4
docs: update TODOs
shawnkchan Oct 13, 2025
b0d5500
changed status_manager to state_manager; resolved type directory
Johnarman1398 Oct 17, 2025
7cad43f
added unit test cases
Johnarman1398 Oct 17, 2025
262854a
fix: use references to edge and node when populating graph and add sh…
shawnkchan Oct 17, 2025
c029957
feat: create separate APIs for update order and making new order
shawnkchan Oct 17, 2025
73aa322
fix: temporarily comment out shared_ptr for Node class
shawnkchan Oct 19, 2025
a74c3ba
refactor: update test cases to use new OrderManager APIs
shawnkchan Oct 19, 2025
d45f943
added equality and inequality def to vda5050 types
Johnarman1398 Oct 20, 2025
6fffa04
updated state manager internal params to VDA5050 State type
Johnarman1398 Oct 20, 2025
bb08ff2
added order handling features
Johnarman1398 Oct 20, 2025
e0d118c
lint
Johnarman1398 Oct 20, 2025
26ce52d
Merge branch 'feat/order-execution' into feat/state-manager
Johnarman1398 Oct 20, 2025
d90375b
updated json keys
Johnarman1398 Oct 20, 2025
b4acfbe
renamed order_manager hpp and cpp files
Johnarman1398 Oct 22, 2025
5df06ef
replaced IStateManager to StateManager
Johnarman1398 Oct 22, 2025
97039f5
fixed last_node_id update of StateManager
Johnarman1398 Oct 23, 2025
e836595
lint src and test files
Johnarman1398 Oct 23, 2025
b40a888
revert clang formatting
Johnarman1398 Oct 23, 2025
3c177c3
Merge pull request #5 from ros-industrial/feat/state-manager
shawnkchan Oct 23, 2025
f5b89e6
fix: decouple order_manager from state_manager by removing reference …
shawnkchan Oct 24, 2025
25a5c3e
fix: remove dependence on referencing StateManager
shawnkchan Oct 27, 2025
9d22083
feat: implements updated test cases for orderManager
shawnkchan Oct 28, 2025
17e4beb
refactor: reorder checks for new order to omit redundant work
shawnkchan Oct 28, 2025
2534367
refactor: update NewOrderNodeStatesNotEmpty test
shawnkchan Oct 28, 2025
d508fda
chore: remove debugging statements
shawnkchan Oct 28, 2025
ae4729f
fix: fixes tests to accomodate refactored OrderManager and existing bugs
shawnkchan Oct 30, 2025
f8350f0
fix: fix missing update to internal state of OrerManager during order…
shawnkchan Oct 30, 2025
a7c4404
refactor: delete order functions that do not return const references
shawnkchan Nov 3, 2025
92247f1
add shared_ptrs to Node, Edge, and OrderGraphElemnt classes
shawnkchan Oct 30, 2025
7362443
fix: fix order graph to store shared_ptrs to node and edge elements
shawnkchan Oct 30, 2025
3a3e329
chore: separate StateManager logic from feat/order-execution branch
shawnkchan Nov 20, 2025
e541dfa
fix: remove state_manager from CMakeLists.txt
shawnkchan Nov 20, 2025
acd5dc1
Merge branch 'refactor/order-execution-shared-ptrs' into feat/order-e…
shawnkchan Nov 20, 2025
2b3e7d4
chore: separate orderGraphValidator logic
shawnkchan Nov 20, 2025
c03ce2c
feat(types): create C++ structs for VDA5050 2.0.0 spec (#6)
sauk2 Nov 20, 2025
782d9ae
refactor: use structs from vda5050_types directory
shawnkchan Nov 20, 2025
c93d367
feat: update CMakeLists to include vda5050_types
shawnkchan Nov 21, 2025
be8cd5f
refactor: refactor order_manager to use vda5050_types
shawnkchan Nov 24, 2025
d1b6362
docs: add docstrings
shawnkchan Nov 24, 2025
dd495a7
refactor: update tests to use vda5050_types
shawnkchan Nov 24, 2025
513f352
fix: fix compiler warning about non-initializied variables for option…
shawnkchan Nov 24, 2025
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
121 changes: 70 additions & 51 deletions vda5050_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,81 +8,91 @@ endif()
find_package(ament_cmake REQUIRED)
find_package(PahoMqttCpp REQUIRED)
find_package(fmt REQUIRED)
find_package(vda5050_types REQUIRED)

include(GNUInstallDirs)

add_library(mqtt_client src/vda5050_core/mqtt_client/paho_mqtt_client.cpp)
target_link_libraries(mqtt_client
PRIVATE
PahoMqttCpp::paho-mqttpp3
)
target_link_libraries(mqtt_client PRIVATE PahoMqttCpp::paho-mqttpp3)
target_include_directories(mqtt_client
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

add_library(logger src/vda5050_core/logger/logger.cpp)
target_link_libraries(logger
PRIVATE
fmt::fmt
)
target_link_libraries(logger PRIVATE fmt::fmt)
target_include_directories(logger
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

add_library(vda5050_core INTERFACE)
target_link_libraries(vda5050_core
INTERFACE
mqtt_client
logger
)
target_link_libraries(vda5050_core INTERFACE mqtt_client logger)
target_include_directories(vda5050_core
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

install(
DIRECTORY include/vda5050_core
DESTINATION include
)

install(
TARGETS
mqtt_client
logger
vda5050_core
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

add_library(order_graph_element src/vda5050_core/order_execution/order_graph_element.cpp)
target_include_directories(order_graph_element
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

add_library(edge src/vda5050_core/order_execution/edge.cpp)
target_include_directories(edge
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(edge order_graph_element)

add_library(node src/vda5050_core/order_execution/node.cpp)
target_include_directories(node
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(node order_graph_element)

add_library(order src/vda5050_core/order_execution/order.cpp)
target_include_directories(order
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(order edge node)

add_library(order_manager src/vda5050_core/order_execution/order_manager.cpp)
target_include_directories(order_manager
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(order_manager order vda5050_types::vda5050_types)

target_link_libraries(vda5050_core
INTERFACE order_graph_element edge node order order_manager)

install(DIRECTORY include/vda5050_core DESTINATION include)

install(TARGETS
mqtt_client
logger
order_graph_element
edge
node
order
order_manager
vda5050_core
EXPORT export_vda5050_core
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

install(
EXPORT export_vda5050_core
install(EXPORT export_vda5050_core
DESTINATION share/${PROJECT_NAME}/cmake
NAMESPACE vda5050_core::
)
NAMESPACE vda5050_core::)

ament_export_targets(export_vda5050_core HAS_LIBRARY_TARGET)
ament_export_dependencies(PahoMqttCpp)
ament_export_dependencies(PahoMqttCpp fmt)

if(BUILD_TESTING)
find_package(ament_cmake_cppcheck REQUIRED)
ament_cppcheck()

find_package(ament_cmake_cpplint REQUIRED)
ament_cpplint()

find_package(ament_cmake_clang_format REQUIRED)
ament_clang_format(
CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../.clang-format"
)

ament_clang_format(CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../.clang-format")
find_package(ament_cmake_copyright REQUIRED)
ament_copyright()

Expand All @@ -91,9 +101,18 @@ if(BUILD_TESTING)
test/unit/mqtt_client/test_mqtt_client_interface.cpp
test/unit/logger/test_logger.cpp
test/unit/logger/test_default_logger.cpp
test/integration/mqtt_client/test_paho_mqtt_client.cpp
)
test/integration/mqtt_client/test_paho_mqtt_client.cpp)
target_link_libraries(test_mqtt_client mqtt_client logger)

find_package(ament_cmake_gtest REQUIRED)

ament_add_gmock(${PROJECT_NAME}_test_OrderManager
test/unit/order_manager/test_order_manager.cpp)
target_include_directories(${PROJECT_NAME}_test_OrderManager
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(${PROJECT_NAME}_test_OrderManager
edge node order_graph_element order_manager)
endif()

ament_package()
78 changes: 78 additions & 0 deletions vda5050_core/include/vda5050_core/order_execution/edge.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* Copyright (C) 2025 ROS-Industrial Consortium Asia Pacific
* Advanced Remanufacturing and Technology Centre
* A*STAR Research Entities (Co. Registration No. 199702110H)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef VDA5050_CORE__ORDER_EXECUTION__EDGE_HPP_
#define VDA5050_CORE__ORDER_EXECUTION__EDGE_HPP_

#include <cstdint>
#include <string>
#include <memory>

#include "vda5050_core/order_execution/order_graph_element.hpp"

namespace vda5050_core {

namespace edge {

/// \brief Class representing a VDA5050 Edge
class Edge : public order_graph_element::OrderGraphElement
{
public:
/// \brief Edge constructor
///
/// \param sequence_id uint32 indicating the sequence number of this edge in an order.
/// \param released Boolean indicating true if this edge is part of the base, false if it is part of the horizon.
/// \param edge_id String that uniquely identifies this edge.
/// \param start_node_id String indicating the first node of the order that this edge belongs to.
/// \param end_node_id String indicating the last node of the order that this edge belongs to.
Edge(
uint32_t sequence_id, bool released, std::string edge_id,
std::string start_node_id, std::string end_node_id);

using Ptr = std::shared_ptr<Edge>;

std::string edge_id() const
{
return edge_id_;
}

std::string start_node_id() const
{
return start_node_id_;
}

std::string end_node_id() const
{
return end_node_id_;
}

private:
/// \brief String that uniquely identifies this edge.
std::string edge_id_;

/// \brief String indicating the first node of the order that this edge belongs to.
std::string start_node_id_;

/// \brief String indicating the last node of the order that this edge belongs to.
std::string end_node_id_;
};

} // namespace edge
} // namespace vda5050_core

#endif // VDA5050_CORE__ORDER_EXECUTION__EDGE_HPP_
69 changes: 69 additions & 0 deletions vda5050_core/include/vda5050_core/order_execution/node.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* Copyright (C) 2025 ROS-Industrial Consortium Asia Pacific
* Advanced Remanufacturing and Technology Centre
* A*STAR Research Entities (Co. Registration No. 199702110H)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef VDA5050_CORE__ORDER_EXECUTION__NODE_HPP_
#define VDA5050_CORE__ORDER_EXECUTION__NODE_HPP_

#include <cstdint>
#include <string>
#include <memory>

#include "vda5050_core/order_execution/order_graph_element.hpp"

namespace vda5050_core {

namespace node {

/// \brief Class that represents a VDA5050 Node
class Node : public order_graph_element::OrderGraphElement
{
public:
/// TODO (shawnkchan) addd shared_ptr to Node class
// using Ptr = std::shared_ptr<Node>;
/// \brief Node constructor
///
/// \param sequence_id uint32 indicating the sequence number of this node in an order
/// \param released Boolean indicating true if this node is part of the base, false if it is part of the horizon
/// \param node_id String that uniquely identifies this node.
Node(uint32_t sequence_id, bool released, std::string node_id);

using Ptr = std::shared_ptr<Node>;

std::string node_id() const
{
return node_id_;
}

bool released() const
{
return released_;
}

uint32_t sequence_id() const
{
return sequence_id_;
}

private:
/// \brief String that uniquely identifies this node.
std::string node_id_;
};

} // namespace node
} // namespace vda5050_core
#endif // VDA5050_CORE__ORDER_EXECUTION__NODE_HPP_
Loading