marcoesposito1988 / cython_catkin_example

Example of integration between Cython and ROS/catkin
18 stars 8 forks source link

Adding other ros specific members, message-types, and etc. in pyx file #2

Closed a-z-e-r-i-l-a closed 4 years ago

a-z-e-r-i-l-a commented 4 years ago

Hi, I had a question about writing the pyx file if our header includes other specifics such as ros::Subcriber, custom message types, or for example boost::shared_ptr . Does it become rather more complex to make a Cython wrapper in such case? Would it become simpler if we want to only access one of the functions from the below example not anything else?

class hw_class : public hw_class::RobotHW 
{
     public:
        hw_class(ros::NodeHandle& nh);
        ~hw_class();

        void update                 (const pkg::MsgType& msg);
        ros::Subscriber            state_sub;
    protected:
        franka::RobotState      robot_state_;
        ros::NodeHandle         nh_;
        boost::shared_ptr<controller_manager::ControllerManager>      controller_manager_;
}

My main goal is actually only to be able to invoke one function from such class on the python side, and don't necessarily need the other methods and attributes. For that single function also any input and output type is ok for me as long as it can pass a few float numbers, whether it is like a list of list or similar to a 2D array. I would be very glad if you could guide me about this matter if possible, and if you may had any suggestions regarding it to share.