Skip to content
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

Og modsat med det her: #7

Closed
MadsRossen opened this issue Dec 25, 2019 · 2 comments
Closed

Og modsat med det her: #7

MadsRossen opened this issue Dec 25, 2019 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@MadsRossen
Copy link
Owner

Hvordan får jeg det her til at publish tallene til den anden node? Tror jeg har gjort det helt forkert...

p1ex/src/navigation.cpp

Lines 31 to 35 in 3f905ad

std_msgs::String msg;
std::stringstream msglen;
msglen << width,length << count;
msg.data = msglen.str();
len_pub.publish(msg);

@MadsRossen MadsRossen added the help wanted Extra attention is needed label Dec 25, 2019
@kajMork
Copy link
Collaborator

kajMork commented Dec 25, 2019

I din stringstream "msglen" indsætter du 3 variabler: "width", "length", og "count".

msglen << width,length << count;

count er en variabel du ikke har defineret og komma er ikke måden man opdeler variabler på i en stringstream, der anvender man "<<".

@kajMork
Copy link
Collaborator

kajMork commented Dec 25, 2019

Og som i map.cpp kører din main funktion ikke i et loop med ros.spin() eller ros.spinOnce() og derfor vil din "msg" kun blive sendt èn gang i og med at main funktionen kun kører én gang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants