Fast-DDS-python icon indicating copy to clipboard operation
Fast-DDS-python copied to clipboard

AttributeError: 'HelloWorld' object has no attribute 'xxx'

Open xuanyuxin opened this issue 2 years ago • 0 comments

I followed the guideline to convert .idl file into required files and I check that the header file does contain the converted data types.

/*!
     * @brief This function sets a value in member dist
     * @param _dist New value for member dist
     */
    eProsima_user_DllExport void dist(
            float _dist);
    /*!
     * @brief This function returns the value of member dist
     * @return Value of member dist
     */
    eProsima_user_DllExport float dist() const;
    /*!
     * @brief This function returns a reference to member dist
     * @return Reference to member dist
     */
    eProsima_user_DllExport float& dist();

However, during the cmake process, there are following warnings:

Fast-DDS-python/install/fastrtps/include/fastdds/dds/core/LoanableTypedCollection.hpp:68: Warning 389: operator[]ignored (consider using %extend) /Fast-DDS-python/install/fastrtps/include/fastdds/dds/core/LoanableTypedCollection.hpp:93: Warning 389: operator[]ignored (consider using %extend) Fast-DDS-python/HelloWorld.h:199: Warning 509:Overloaded method HelloWorld::dist() effectively ignored, Fast-DDS-python/HelloWorld.h:193: Warning 509: as itis shadowed by HelloWorld::dist() const. Fast-DDS-python/HelloWorld.h:219: Warning 509:Overloaded method HelloWorld::bool() effectively ignored, Fast-DDS-python/HelloWorld.h:213: Warning 509: as itis shadowed by HelloWorld::bool() const. Fast-DDS-python/HelloWorld.h:234: Warning 509:Overloaded method HelloWorld::list(std::vector<float,std::allocator< float > > &&) effectively ignored,

When running the Publisher and Subscriber, there is the error: AttributeError: 'HelloWorld' object has no attribute 'dist'

xuanyuxin avatar Dec 07 '23 10:12 xuanyuxin