-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dds::core::InvalidArgumentError when trying to send sample #498
Comments
I just tried it with //Publisher
#include "dds/dds.hpp"
#include "HelloWorldData.hpp"
using namespace org::eclipse::cyclonedds;
int main()
{
dds::domain::DomainParticipant participant(0);
dds::topic::Topic<trajectory_msgs::msg::dds_::JointTrajectory_> topic(participant, "topic");
auto p_qos = participant.default_publisher_qos();
dds::pub::Publisher publisher(participant, p_qos);
auto qos = publisher.default_datawriter_qos();
dds::pub::DataWriter right_joint_publisher_(publisher, topic, qos);
trajectory_msgs::msg::dds_::JointTrajectory_ msg{};
msg.header().stamp(builtin_interfaces::msg::dds_::Time_{3, 4});
msg.header().frame_id("base_link");
std::vector<std::string> joint_names;
const int N = 3;
joint_names.reserve(N);
std::vector<double> positions;
positions.reserve(N);
joint_names.push_back("a");
positions.push_back(1.0);
joint_names.push_back("b");
positions.push_back(2.0);
joint_names.push_back("c");
positions.push_back(3.0);
msg.joint_names(joint_names);
msg.points({trajectory_msgs::msg::dds_::JointTrajectoryPoint_{positions, {}, {}, {}, builtin_interfaces::msg::dds_::Duration_{0, 0}}});
sleep(3);
// Small abstraction calls write on the DataWriter
right_joint_publisher_ << msg;
sleep(1);
} and
|
We're using 0.10.5, (it's packaged manually by us into a debian package, so maybe something went wrong with building it? Although we build with all default settings). I'll try your test and see if it works |
So I'm not sure what happened, I haven't changed to code but it's working now. Thanks for putting in the effort to help me out |
I have a native dds application that communicates with ROS2, for the most part it works perfectly fine. However I just added a publisher for some joint trajectories, which now fails with the InvalidArgumentError.
The C++ snippet:
If I don't put the positions into the trajectory_msgs::msg::dds_::JointTrajectoryPoint_ struct it sends fine, but as it is above it throws the error.
Error:
The text was updated successfully, but these errors were encountered: